【发布时间】:2021-08-12 13:35:28
【问题描述】:
我有如下的蜂巢表
create external table transaction(
id int,
name varchar(60))
month string
)
PARTITIONED BY (
year string,
transaction_type_code varchar(20)
)
STORED AS PARQUET
LOCATION 'hdfs://xyz';
我正在创建一个带有多个分区列 dt 的另外一个外部表,如下所示
create external table transaction_copy(
id int,
name varchar(60))
month string
)
PARTITIONED BY (
dt string,
year string,
transaction_type_code varchar(20)
)
STORED AS PARQUET
LOCATION 'hdfs://xyz';
如下添加分区
alter table transaction_copy add if not exists partition (dt='20210811') LOCATION 'hdfs://xyz';
遇到异常
ERROR: Error while compiling statement: FAILED: ValidationFailureSemanticException partition spec {dt=20210810} doesn't contain all (3) partition columns
我可以通过传递所有 3 个分区来添加分区。
是否也可以只传递一个分区?
【问题讨论】:
标签: hive hadoop2 hadoop-partitioning data-partitioning hiveddl