【发布时间】:2017-10-26 14:01:28
【问题描述】:
假设我在 Hive 中有内部 orc 非分区表:
CREATE TABLE IF NOT EXISTS non_partitioned_table(
id STRING,
company STRING,
city STRING,
country STRING,
)
STORED AS ORC;
是否可以通过 cte like 语句以某种方式创建 parquet 分区表?
create partitioned_table PARTITION ON (date STRING) like non_partitioned_table;
alter table partitioned_table SET FILEFORMAT PARQUET;
此创建语句不起作用。
所以基本上我需要添加列并使表按此列分区。我知道我可以通过简单的 create table 语句来创建表,但我需要在 CREATE TABLE LIKE 中完成它并以某种方式进行更改
【问题讨论】: