0
votes

I created a avro table with buckets but I face the following error:

Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Bucket columns uniqueid is not part of the table columns ([]

CREATE TABLE s.TEST_OD_V(
UniqueId int,
dtCd string,
SysSK int,
Ind string)
PARTITIONED BY (vcd STRING)
CLUSTERED BY (UniqueId) INTO 500 BUCKETS
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
STORED AS INPUTFORMAT                'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
TBLPROPERTIES ('avro.schema.url'='s3a:/bucket/schema/pr_v.avsc');              

I'm using hive 1.1. Kindly help me..

1

1 Answers

0
votes

Try this (avaliable from Hive 0.14):

CREATE TABLE s.TEST_OD_V( UniqueId int, dtCd string, SysSK int, Ind string) PARTITIONED BY (vcd STRING) CLUSTERED BY (UniqueId) INTO 500 BUCKETS STORED AS AVRO;