Venkadesh Venkat
Venkadesh Venkat

Reputation: 175

Hive bucketing and partition for existing table

Is it possible to create bucketing and partitioning for a table that already contains data? I have a table in hive with more than 100M of records and I want to create a partition on the table. Also I need to create the bucketing.

Is it possible?

Thanks, Bala

Upvotes: 3

Views: 3294

Answers (1)

Aman Mundra
Aman Mundra

Reputation: 864

No, it's not possible to alter bucketing and partitioning within a preloaded table, you may have to create a new table with required bucketing and partitioning properties and then load it from the old table.

set hive.enforce.bucketing = true;
FROM old_table insert into table new_bucketed_partitioned_table select * ;

Upvotes: 1

Related Questions