insert overwrite local directory '/export/servers/exporthive/a'
select * from score;
insert overwrite local directory '/export/servers/exporthive' row format delimited fields terminated by '\t' collection items terminated by '#'
select * from student;
collection items terminated by '#' 對集合型別使用#來進行分割
insert overwrite directory '/export/servers/exporthive' row format delimited fields terminated by '\t' collection items terminated by '#'
select * from score;
注: 對於集合型別我們使用#來進行分割,因為這個表裡面沒有集合型別,所以加不加這個結果都一樣
dfs -get /export/servers/exporthive/000000_0 /export/servers/exporthive/local.txt;
bin/hive -e "select * from myhive.score;"
> /export/servers/exporthive/score.txt
export table score to '/export/exporthive/score'
;
只能清空管理表,也就是內部表
truncate table score5;
hive hive中建立表
一 建立表語句 create table if not exists mydb.employees name string comment employee name salary float subordinates arraydeductions mapaddress struct commen...
Hive hive表中載入資料
五種情況 create table score3 like score 插入資料 insert into table score3 partition month 201807 values 001 002 100 通過load方式載入資料 load data local inpath export...
大資料 匯出Hive表中的資料
匯出hive表中的資料方式由很多種。一下就介紹一下 insert overwritelocaldirectory opt datas hive emp exp row format delimited fields terminated by t collection items terminate...