【发布时间】:2021-05-03 20:12:09
【问题描述】:
假设我在 Hive 中有一个名为“ccm”的非事务性表。它有数百列和一个分区字段。
我知道如何使用“create table abc like ccm”创建副本,但我希望将 abc 分桶、ORC,并通过 TBLPROPERTIES 设置事务支持。
我在编写 HQL 时不想提及 ccm 中的所有列。
我可以这样做吗?
【问题讨论】:
假设我在 Hive 中有一个名为“ccm”的非事务性表。它有数百列和一个分区字段。
我知道如何使用“create table abc like ccm”创建副本,但我希望将 abc 分桶、ORC,并通过 TBLPROPERTIES 设置事务支持。
我在编写 HQL 时不想提及 ccm 中的所有列。
我可以这样做吗?
【问题讨论】:
这个答案可能对你的情况有正确的处理方法,它也解释了所用方法的一些限制。
Create hive table using "as select" or "like" and also specify delimiter
因此,从示例中,您应该添加缺少的部分:
我怀疑您能否完全达到您的预期结果,但我认为这是向前迈出的一步
【讨论】:
hive> create table test clustered by (acctnum) into 50 buckets stored as ORC tblproperties('transactional'='true') as select * from ccm; 是:FAILED: SemanticException [Error 10068]: CREATE-TABLE-AS-SELECT does not support partitioning in the target table