hadoop - HIVE: Empty buckets getting created after partitioning in HDFS -
i trying create partition , buckets using hive.
for setting of properties:
set hive.enforce.bucketing = true; set hive.exec.dynamic.partition = true; set hive.exec.dynamic.partition.mode = nonstrict;
below code creating table:
create table transactions_production ( id string, dept string, category string, company string, brand string, date1 string, productsize int, productmeasure string, purchasequantity int, purchaseamount double) partitioned (chain string) clustered by(id) 5 buckets row format delimited fields terminated ',' stored textfile;
below code inserting data table:
insert overwrite table transactions_production partition (chain) select id, dept, category, company, brand, date1, productsize, productmeasure, purchasequantity, purchaseamount, chain transactions_staging;
what went wrong:
partitions , buckets getting created in hdfs data present in 1st bucket of partitions; remaining buckets empty.
please let me know did wrong , how resolve issue.
when using bucketing, hive comes hash of clustered value (here use id) , splits table many flat files inside partitions.
because table split hashes of id's size of each split based on values in table.
if have no values mapped buckets other first bucket, flat files empty.
Comments
Post a Comment