Skip to content

Instantly share code, notes, and snippets.

@milindjagre
Created May 5, 2017 19:24
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/a373527be7983bc9db40cc6ccda8a501 to your computer and use it in GitHub Desktop.
Save milindjagre/a373527be7983bc9db40cc6ccda8a501 to your computer and use it in GitHub Desktop.
this pig script is used for loading the data stored in pig relation in to the hive table
-- this pig script is used for storing the data in pig relation into a hive table
-- loading the data in the input file into a pig relation with the custom schema
-- this custom schema is used for constructing the hive table
input_data = LOAD '/hdpcd/input/post18/post18.csv' USING PigStorage(',') AS (station_name:chararray, year:int, month:int, dayofmonth:int, precipitation:int, temperature_max:int, temperature_min:int);
-- storing the input_data pig relation data into a hive table called sfo_weather using HCatalog
STORE input_data INTO 'sfo_weather' USING org.apache.hive.hcatalog.pig.HCatStorer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment