Hive外部表操作alter加载数据,并解决空问题

时间:2021-09-06 21:49:37   收藏:0   阅读:17

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

原文:https://www.cnblogs.com/hbym/p/15232972.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!