Breaking News
Loading...

Writing Pig Scripts



Pig Scripts:



Step1:  Input file a
0,1,2
1,3,4

Step2: Create a file by name  pigex1.pig and add the below code to it
/*
* pigex1.pig
* Another line of comment
*/
log = LOAD '$input'  using PigStorage AS (a1:int,a2:int,a3:int);
lmt= LIMIT log $size;
DUMP lmt;
--End of program
Step3:




                                             (or)

Step4:  Using parm file paramspig and add the below parms in it
Input=/var/lib/hadoop-0.20/inputs/pigexamples/pigex1.pig
size = 2






- See more at: http://labstrikes.blogspot.in/2012/08/adsense-middle-blog-post.html#sthash.gQgSkqx8.dpuf
 
Toggle Footer