简体   繁体   English

现有表的配置单元存储和分区

[英]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. 我的蜂巢中有一个表,记录超过100M,我想在该表上创建一个分区。 Also I need to create the bucketing. 另外,我需要创建存储区。

Is it possible? 可能吗?

Thanks, Bala 谢谢,巴拉

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 * ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM