After I changed org.apache.hcatalog.pig.HCatStorer() to org.apache.hive.hcatalog.pig.HCatStorer(), it worked.

Patcharee

On 01/14/2015 02:57 PM, Patcharee Thongtra wrote:
Hi,

I am having a weird problem. I created a table in orc format:

--------------------------------
Create table
--------------------------------
create external table cossin (x int, y int, cos float, sin float) PARTITIONED BY(zone int) stored as orc location '/apps/hive/warehouse/wrf_tables/cossin' tblproperties ("orc.compress"="ZLIB");

I run a pig script below to import data into this table 'cossin'.

--------------------------------
Pig script
--------------------------------
...
r_three_dim = FOREACH result_three_dim GENERATE
         $ZONE as zone: int,
         result::x as x: int, result::y as y: int,
         result::cos as cos: float, result::sin as sin: float;

x = FILTER r_three_dim by x < 5 and y < 5;
dump x;
describe x;

store x into 'cossin' using org.apache.hcatalog.pig.HCatStorer();

--------------------------------
Dump x
--------------------------------
(2,3,3,0.9883806,-0.15199915)
(2,3,4,0.98836243,-0.15211758)
(2,4,1,0.98830783,-0.15247186)
(2,4,2,0.9882811,-0.15264522)
(2,4,3,0.9882628,-0.15276346)
(2,4,4,0.98824626,-0.15287022)
x: {zone: int,x: int,y: int,cos: float,sin: float}

But when I checked the table 'cossin', zone is NULL instead on 2.

Any ideas?

BR,
Patcharee


Reply via email to