Categories

Apr 24 in Big Data | Hadoop

Q:

Bucketing in Dynamic Partition

Step 1:

hive> set hive.enforce.bucketing=true;
hive> set hive.exec.dynamic.partition.node=nonstrict;

Step 2: Create a partition table and buckets inside that,

hive> create table partition_table(id int,lastname string) partitioned by(firstname string) clustered by (id) into 5 buckets row format delimited fields terminated by ',';

Step 3: Insert data into the partition table.

 hive> insert into partition_table partition (firstname) select id,lastname.firstname from table1;
 select * from partition_table;

Step 4: You can see the partition in the UI.

Related questions

Madanswer
Apr 24 in Big Data | Hadoop
Apr 8 in Big Data | Hadoop
Jan 10 in Big Data | Hadoop
...