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
STORED AS ORC
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?
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)