Last active
March 14, 2017 15:32
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Enabled the Soft Wrap option