-
在自己电脑上excel里录入内容
-
复制去txt
在notepad++ 里查看一下所有符号,保持一致。有时候 --> 会变成 .....
-
上传至linux 自己账号下,俗称本地。没有上传就 vim a.txt这种,复制粘贴进去
rz -y
- pwd获取 txt的路径
- hive中创建表
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进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;
网友评论