Sponsored Content
Top Forums Shell Programming and Scripting Writing Hbase and pig scripts in the bash script file Post 302901675 by shree11 on Thursday 15th of May 2014 12:58:19 AM
Old 05-15-2014
Writing Hbase and pig scripts in the bash script file

Hi,

I have a script file where i'm validatig the input file and storing the validated records on HDFS.
I wanted to load data from HDFS to HBASE using pig script. So for that i have created a HBASE table and written pig script to load data from HDFS to HBASE which is working fine. Now i wanted those scripts to be wriitn in the .sh file. so that it has to create hbase table and then should call pig shell and do the loading part. How can i write hbase and pig script in .sh file ?
Below is my hbase shell command :
Code:
CREATE 'gooddata','good'

My PIG script is :
Code:
G = LOAD '/user/user/dataparse/goodrec_051420142023' USING PigStorage(',') as (c1:chararray, c2:chararray,c3:chararray,c4:chararray,c5:chararray);
STORE G INTO 'hbase://gooddata' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage('good:name good:state good:phone_no good:gender');

How can i write these scripts to the .sh file ?

Thanks,
Shree
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems writing bash script to unzip files

I'm getting the following errors when I try to write a script to unzip some zip files. When I use the free trial copy of the commerical winzip program, however, they work fine. When I use -l or -t on unzip it indicates no errors. When I use the -o switch interactively from the bash command line it... (1 Reply)
Discussion started by: siegfried
1 Replies

2. Shell Programming and Scripting

Writing Bash script

Could anyone help me to Write a script in BASH Shell to determine the percentage of system disk space you are using. (1 Reply)
Discussion started by: boris
1 Replies

3. Shell Programming and Scripting

Help with writing simple bash script

I want to write a bash script to: 1. Send an email from localhost to an external gmail account. (gmail then automatically forwards the message back to a pop account on the same server. 2. Script waits 3 minutes then checks to see if the email arrived, and if not, it sends an email to... (9 Replies)
Discussion started by: sallyanne
9 Replies

4. Shell Programming and Scripting

Writing Bash shell scripts corresponding to windows bat files

Experts, I am newbie in shell scripting. I want to write Bash shell scripts corresponding to windows bat files. I have installed cygwin at c:\cygwin and i am trying to crate the sh file using vi editor. i am not able to understand how to use linux/unix convention for the code. following is my... (15 Replies)
Discussion started by: rajuchacha007
15 Replies

5. Homework & Coursework Questions

brand new user!.. Lost on BASH script writing

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have just gotten into writing bash scripts for a class, part of the assignment is to read and be able to tell... (4 Replies)
Discussion started by: Byrang
4 Replies

6. Shell Programming and Scripting

Writing a bash script using host

Im trying to write a script using the host command but its not working properly. I cant understand what Im doing wrong. When I use it at the command prompt, it works fine. But its being used actually in the script, it says its not found: 2 SERVFAIL. Can anyone help me? Here's what I have so far: no... (6 Replies)
Discussion started by: relsha
6 Replies

7. Shell Programming and Scripting

Mkbootfs writing to stdout in bash script

Hi, I need to automate some repacking tasks of a boot image for Android When in command line, I can use this command: mkbootfs /path/to/root > /path/to/ramdisk-recovery.cpio;However, if I try to run the command from a shell script under Ubuntu, it fails and outputs to stdout instead of the... (27 Replies)
Discussion started by: Phil3759
27 Replies

8. Shell Programming and Scripting

Question about writing a bash script

Hello, I want to write a bash script to delete the content after '#'. However, if '#' appears in a string with "", ignore this. For example, input file: test #delete "test #not delete" Output file: test "test #not delete" Does anyone know how to write this script? Thanks (1 Reply)
Discussion started by: jeffwang66
1 Replies

9. Shell Programming and Scripting

Writing hive scripts in bash script file

Hi, I wanted to load data from HDFS to HIVE by writing bash script. Description: I have written a bash script to validate the data and loaded validated data from local file system to HDFS. Now in the same bash script i wanted to load the data from HDFS to HIVE. How can i do it ? Also how tyhe... (2 Replies)
Discussion started by: shree11
2 Replies

10. Shell Programming and Scripting

Read CSV file and delete hdfs, hive and hbase tables

I have a CSV file with hdfs directories, hive tables and hbase tables. 1. first column - hdfs directories 2. second column - hive tables 3. third column - hbase tables I have to check the csv file and look for the first column and delete the hdfs directory from the hdfs path, now... (2 Replies)
Discussion started by: shivamayam
2 Replies
STRCPY(3)						   BSD Library Functions Manual 						 STRCPY(3)

NAME
stpcpy, strcpy, strncpy -- copy strings LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> char * stpcpy(char *s1, const char *s2); char * strcpy(char *restrict s1, const char *restrict s2); char * strncpy(char *restrict s1, const char *restrict s2, size_t n); DESCRIPTION
The stpcpy() and strcpy() functions copy the string s2 to s1 (including the terminating '' character). The strncpy() function copies at most n characters from s2 into s1. If s2 is less than n characters long, the remainder of s1 is filled with '' characters. Otherwise, s1 is not terminated. The source and destination strings should not overlap, as the behavior is undefined. RETURN VALUES
The strcpy() and strncpy() functions return s1. The stpcpy() function returns a pointer to the terminating '' character of s1. EXAMPLES
The following sets chararray to ``abc'': char chararray[6]; (void)strncpy(chararray, "abc", sizeof(chararray)); The following sets chararray to ``abcdef'': char chararray[6]; (void)strncpy(chararray, "abcdefgh", sizeof(chararray)); Note that it does not NUL terminate chararray, because the length of the source string is greater than or equal to the length argument. The following copies as many characters from input to buf as will fit and NUL terminates the result. Because strncpy() does not guarantee to NUL terminate the string itself, this must be done explicitly. char buf[1024]; (void)strncpy(buf, input, sizeof(buf) - 1); buf[sizeof(buf) - 1] = ''; This could be better achieved using strlcpy(3), as shown in the following example: (void)strlcpy(buf, input, sizeof(buf)); Note that, because strlcpy(3) is not defined in any standards, it should only be used when portability is not a concern. SECURITY CONSIDERATIONS
The strcpy() function is easily misused in a manner which enables malicious users to arbitrarily change a running program's functionality through a buffer overflow attack. (See the FSA and EXAMPLES.) SEE ALSO
bcopy(3), memccpy(3), memcpy(3), memmove(3), strlcpy(3) STANDARDS
The strcpy() and strncpy() functions conform to ISO/IEC 9899:1990 (``ISO C90''). The stpcpy() function is an MS-DOS and GNUism. The stpcpy() function conforms to no standard. HISTORY
The stpcpy() function first appeared in FreeBSD 4.4, coming from 1998-vintage Linux. BSD
August 9, 2001 BSD
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy