Skip to content

Instantly share code, notes, and snippets.

@milindjagre
Last active March 14, 2017 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milindjagre/094e3c08f0dcd8124b1dedaf6979b520 to your computer and use it in GitHub Desktop.
Save milindjagre/094e3c08f0dcd8124b1dedaf6979b520 to your computer and use it in GitHub Desktop.
This Pig Script is used to load the Pig Relation with input.csv file and with the defined schema in the AS block
--We use LOAD command to load data into a PIG Relation
--The keyword "AS" indicates the Pig Relation creation with a defined schema
data_with_schema = LOAD '/hdpcd/input/post11/input.csv' USING PigStorage(',') AS (station_name:chararray, year:int, month:int, dayofmonth:int, precipitation:int, maxtemp:int, mintemp:int);
--Dumping the structure of the Pig Relation "data_with_schema" created in the above line
DESCRIBE data_with_schema;
--Dumping the actual data stored in Pig Relation "data_with_schema"
DUMP data_with_schema;
@milindjagre
Copy link
Author

Enabled the Soft Wrap option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment