【发布时间】:2018-08-15 00:59:52
【问题描述】:
我想基于另一个未分区表创建一个新的分区表。 新表应按旧表的列进行分区。然后我想在新表中加载所有旧数据。
CREATE TABLE new_table PARTITIONED BY (id) STORED AS PARQUET AS SELECT * FROM old_table
如here* 所述,id 应该是最后一列,但它是 old_table 中的第一列。 old_table 包含很多列,所以我不想列出所有列。我能做什么?
*-- We expect this CTAS to fail because non-key column S
-- comes after key columns YEAR and MONTH in the select list.
create table partitions_maybe partitioned by (year, month)
as select year, month, s from partitions_no;
ERROR: AnalysisException: Partition column name mismatch: year != month
【问题讨论】: