Database Reference
In-Depth Information
apress_team|technology|A whole bunch of new
technology topics about to come. Watch this
space!
2.
Run the following command to load the tweets file using PigStor-
age with the Grunt shell:
pipe_input = LOAD '/home/vivek/input/
tweets.txt' USING PigStorage('|');
3.
To dump the output of pipe_input (as shown in Figure 6-6 ) , run
the following command:
dump pipe_input;
Figure 6-6 . Output of the MapReduce program
STORE
This function is used to load intermediate or computed Pig script results on output res-
ults in the file system. In the following example, we are reading tweets.txt con-
taining fields delimited by '|' and storing it as a file containing fields delimited by ','
(see Figure 6-7 ).
pipe_input = LOAD '/home/vivek/input/tweets.txt' USING
PigStorage('|') as
(screen_name:chararray,category:chararray,body:chararray);
csv_output = Store input into '/home/vivek/output/
tweets.csv' USING PigStorage(',');
 
 
 
Search WWH ::




Custom Search