Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@milindjagre
Last active March 25, 2017 19:50
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/a7690321c6888f17ffba3e0794055618 to your computer and use it in GitHub Desktop.
Save milindjagre/a7690321c6888f17ffba3e0794055618 to your computer and use it in GitHub Desktop.
This pig script loads the data from the hive table to the pig relation
--execute this file by using -useHCatalog flag
--the flag "-useHCatalog" enables Pig to pick jars for HCatalog
--HCatalog is used for loading data from Apache Hive to Pig
--loading the data in "products" hive table into a Pig Relation
hive_data = LOAD 'products' USING org.apache.hive.hcatalog.pig.HCatLoader();
--looking at the structure of the data
DESCRIBE hive_data;
--dumping the data on the terminal window
DUMP hive_data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment