Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. --this file is used for data transformation using Apache Pig
  2. --we will load the data from post13.txt file and transform it
  3.  
  4. --LOAD command is used for loading the data in input_data pig relation
  5. input_data = LOAD '/hdpcd/input/post13/post13.txt' USING PigStorage(',');
  6.  
  7. --input_data pig relation is transformed and we extract only
  8. --first name, location and the program from the original input
  9. flat_data = FOREACH input_data GENERATE $1 as fname, $3 as location, $5 as program;
  10.  
  11. --at last, we print the flat_data pig relation for confirmation
  12. --DUMP command is used for printing the pig relation contents to the terminal window
  13. dump flat_data;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement