Support Questions
Find answers, ask questions, and share your expertise

Loading Bucketed ORC Table using Pig

New Contributor

I am able to load data from non-bucketed ORC tables using Pig. However, when I try to load data from a bucketed ORC table, it read 0 records.

The ORC table was created using the following statement in Hive:

CREATE TABLE orctable1(a1 INT, b1 INT, c1 STRING)

CLUSTERED BY (a1) into 3 buckets


TBLPROPERTIES ("transactional"="true") ;

FROM mytable INSERT INTO TABLE orctable1 SELECT nbr, val, txt;

I tested the table with a SELECT statement and the data was successfully loaded.

I try to load the table in grunt using:

A = LOAD 'orctable1' USING org.apache.hive.hcatalog.pig.HCatLoader();


It gave a Success message but 0 records was recorded. Is there a solution to this?


Expert Contributor

Did you use the same user for both? Could it be a permissions issue? Did you see any error messages?

New Contributor

Both were done by the same user. I tried loading the data using admin but I still get the same result.

There were no error messages.job-1475806680839-0016-logs.txt

Expert Contributor

OK, I was totally able to reproduce your issue, then re-worked the query back until it 'worked' again. The issue seems to be with TBLPROPERTIES ("transactional"="true") ;. If you remove that from the table create statement then everything works. NOTE: I didn't test out the full configuration that was required to use transactions. Did you setup hive for transactions? (It's off by default)