hdfs常用命令,可查看博文
hdfs常用命令
//从本地加载数据到表,linux上的文件不会丢失,相当于是复制 ,这是 追加的模式
load data local inpath '/data/log/1.txt' into table employee;
//从本地加载数据到表,linux上的文件不会丢失,相当于是复制 ,overwrite 是 覆盖的模式
load data local inpath '/data/log/2.txt' overwrite into table t1
//从hdfs将文件加载到hive表,同时hdfs上的文件会丢失,相当于是移动文件
load data inpath '/user/oozie/oozie_test/dir8/1.txt' into table employee;
//导出表的数据到hdfs中
insert overwrite directory '/user/oozie/oozie_test/t2'
select * from json
//导出数据到linux系统中
insert overwrite local directory '/data/log/hive/1'
select * from json
insert overwrite local directory '/data/log/hive/1'
row format delimited
fields terminated by ','
select * from json