hive学习笔记(纯手工)
发布日期:2022-02-27 02:37:50 浏览次数:58 分类:技术文章

本文共 758 字,大约阅读时间需要 2 分钟。

DDl DATA DEFINE LANGUAGE

分区表

create table if not exists t3(

id int,
name string,
score int
)
clustered by(id) partitioned by (dt string)
row format delimited fields terminated by “:”
collection terminated by “,”
map key terminater by “:”;

load data inpath “/home/oliver/data/t1.dat” into

table t3 partition(dt=“2020-06-01”);

show partition t3;

alter table t3 add partition(dt=“2020-06-03”);

alter table t3 add partition(dt=“2020-06-06”) partition(dt=“2020-06-07”);

alter table t3 add partition(dt=“2020-06-07”) location ‘/user/hive/warehouse/mydb.db/t3/dt=2020-06-07’

alter table t3 drop partition(dt=“2020-06-07”);

alter table t3 partition()

#修改分区的hdfs路径

alter table t3 partition(dt=‘2020-06-07’) set location ‘/user/hive/warehouse/mydb.db/t3/dt=2020-06-06’

转载地址:https://blog.csdn.net/weixin_43377681/article/details/116562276 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:hive的时间函数
下一篇:【IDEA2019.3版本】AJAX请求报错404:URL设置与Servlet映射不一致所致

发表评论

最新留言

表示我来过!
[***.240.166.169]2024年03月31日 23时44分11秒