hive增删改查操作

增加数据:

(1)查询表数据再插入(覆盖)

hive> insert into table dhi_sk_repair_deed_test select * from dhi_sk_repair_deed limit 100;

hive> insert overwrite table dhi_sk_repair_deed_test select * from dhi_sk_repair_deed limit 100;

(2)从本地文件插入数据:

hive> load data local inpath '/opt/data/an.log' into table dh_cook;

(3)添加分区 并 加载数据

hive>load data local inpath ‘/home/test.txt’into table test_count_day partition(partition_date='2018-04-22');

(4)从HDFS文件插入数据:

扫描二维码关注公众号,回复: 1592780 查看本文章

shell> hadoop fs -mv file01 file02


猜你喜欢

转载自blog.csdn.net/lhxsir/article/details/79637591