Accessing Table Data with Pig
When using table information from the Hive metastore with Pig, add the -useHCatalog option when invoking pig:
$ pig -useHCatalog test.pig
In the script, use HCatLoader to have table schema retrieved automatically:
A = LOAD 'groups' USING org.apache.hive.hcatalog.pig.HCatLoader(); DESCRIBE A;
Output:
A: {name: chararray,placeholder: chararray,id: int}
Page generated May 18, 2018.
<< Accessing Table Data with MapReduce | ©2016 Cloudera, Inc. All rights reserved | Accessing Table Information with REST >> |
Terms and Conditions Privacy Policy |