-
在自己電腦上excel里錄入內(nèi)容
-
復(fù)制去txt
在notepad++ 里查看一下所有符號,保持一致堪夭。有時候 --> 會變成 .....
上傳至linux 自己賬號下巧勤,俗稱本地。沒有上傳就 vim a.txt這種票顾,復(fù)制粘貼進(jìn)去
rz -y
- pwd獲取 txt的路徑
- hive中創(chuàng)建表
CREATE TABLE `vip_mid.paypoint_tmp2`(
`plat` string,
`channel` string,
`position` string,
`paypoint` string,
`refer_name` string)
row format delimited fields terminated by '\t'
--lines terminated by '\n'
stored as textfile;
- load進(jìn)hive
load data local inpath '/home/zhangzhiyu/cure/a.txt' overwrite into table vip_mid.paypoint_tmp2;
語句中要有 stored as textfile 否則會報下面的錯誤
報錯:
Failed with exception Wrong file format. Please check the file's format.
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.MoveTask
- 插入最終的表
insert into vip_mid.paypoint_tmp select * from vip_mid.paypoint_tmp2;