Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Pig to Hive dataload - error

Pig to Hive dataload - error

Explorer

Dear Experts,

 

I scooped records from Mysql and kept in HDFS. Now using Pig query I like to load into Hive table, and here I stuck.

 

Hive table describe:
order_id INT,
order_date timestamp,
order_customer_id INT,
order_status VARCHAR(45)

 

Code:

pig -useHCatalog

orders = LOAD '/user/root/sqoop_import/orders' USING PigStorage(',') AS (
order_id:Int,
order_date:chararray,
order_customer_id:Int,
order_status:chararray
);

STORE orders INTO 'pig_demo.orders' USING org.apache.hive.hcatalog.pig.HCatStorer();

 

ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1002: Unable to store alias orders
Details at logfile: /home/cloudera/pig_1487194649279.log

 

thnx

1 REPLY 1
Highlighted

Re: Pig to Hive dataload - error

Guru

Hi Alikanti,

 

Any reason that you want to use Pig to load data into Hive? You can run directly from Hive like below:

 

LOAD DATA INPATH '/user/root/sqoop_import/orders' OVERWRITE INTO TABLE table_name;

More details can be found here:

https://cwiki.apache.org/confluence/display/Hive/GettingStarted