1. 程式人生 > >Hive從HDFS中載入資料

Hive從HDFS中載入資料

建表

        以手機流量資訊為例插入30w行資料

 

create table flow(id string,phonenum string,mac string,ip string,num1 int,num2 int,up int,down int,allflow int) row format delimited fields terminated by "\t";

列名不能與關鍵字相同

載入資料

 

load data inpath '/hadoop/input/flow.log' into table flow;

1s載入完成

 

查詢

 

select * from flow;

 

結果

===============================================