1.引入分区表(需要根据日期对日志进行管理)
/user/hive/warehouse/log_partition/20190101/20190101.log
/user/hive/warehouse/log_partition/20190102/20190102.log
/user/hive/warehouse/log_partition/20190103/20190103.log
2.创建分区表语法
…
create table dept_partition(
deptno int,
dname string,
loc string
)
partitioned by (month string)
row format delimited fields terminated by ‘\t’;…
3.加载数据到分区表中
load data local inpath ‘/home/hadoop/data/dept201901.txt’ into table dept_partition partition(month=‘201901’);
坑一:Failed with exception MetaException(message:For direct MetaStore DB connections, we don’t support retries at the client level.)
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
https://blog.youkuaiyun.com/qq_35732963/article/details/54291970
load data local inpath ‘/home/hadoop/data/dept201902.txt’ into tab

本文详细介绍了如何在Hive中管理和删除分区表,包括创建分区表、加载数据、查询数据以及通过元数据删除分区表的操作,并强调了在删除过程中需要注意的坑和解决方法。
最低0.47元/天 解锁文章
290

被折叠的 条评论
为什么被折叠?



