CREATE TABLE test1 (
no bigint,
tm bigint,
val string
--p_date string COMMENT 'partition date, yyyyMMdd'
)
partitioned by(p_date
string COMMENT 'partition date, yyyyMMdd')
row format delimited fields terminated by ','
stored as orc;
--添加分区到表
alter table szq.test1 add partition (p_date='t20201001') location 'hdfs://nameservice1/oldorc/can/t20201001';
--数据显示不出来时候,修复表
msck repair table test1
--删除分区
alter table test1 drop partition(p_date='t20210225');
--使用presto读取表数据
select * from test1 limit 10