栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

HIVE日常使用笔记

HIVE日常使用笔记

1 hive一次性删除多个分区数据
-----SQL------
alter table tranods.name drop if exists 
partition (dt='20220110')
,partition (dt='20220111')
,partition (dt='20220109')
----结果展示-----
Logging initialized using configuration in file:/etc/hive/conf.dist/hive-log4j2.properties Async: false
hive> alter table tranods.name drop if exists partition (dt='20220110'),partition (dt='20220111'),partition (dt='20220109');
Dropped the partition dt=20220111
Dropped the partition dt=20220110
Dropped the partition dt=20220109
OK
Time taken: 2.129 seconds

温馨提示:如果一次性拼接过多的分区,hive会执行报错,所以可以分批次执行

2 hive添加分区指定多个子路径
alter table tranods.name add partition (dt='20210728') 
location 's3://.your path.../log_data/20210728/{16,17,18,19,20,21,22,23}/*';

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/707865.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号