工具篇:hive

一、hive

#建表
hive -e "create table materials_list(mid string, type string) PARTITIONED BY (dt string) row format delimited fields terminated by '\t'"

#导入文件到表中
hive -e "load data local inpath '/path/to/file.txt' into table materials_list partition (dt='20181212')"

#查询
hive -e "select * from materials_list where dt='20181212' limit 10"

#删除
hive -e "delete from materials_list where dt='20181212'"

#后台运行sql文件, 并导出结果到文件
nohup hive -f file.sql > result.log 2>&1 &

 二、

 

你可能感兴趣的:(工具,hive)