Author: Hao Zhu
Original Publication Date: January 27, 2015
This article shows how to access a Hive table with RCFile storage in Pig.
1. Create a Hive table with RCFile storage.
create table rcfile_table (x int) stored as rcfile;
2. Locate piggybank.jar.
For example, in MapR Pig 0.13, it is located at:
3. Register the jar in Pig and then you can load the RCFile table.
$ pig -useHCatalog
grunt> register /opt/mapr/pig/pig-0.13/contrib/piggybank/java/piggybank.jar
grunt> a = LOAD '/user/hive/warehouse/rcfile_table' USING org.apache.pig.piggybank.storage.HiveColumnarLoader('x int');