HIVE 载入本地数据文件报错

来源:互联网 发布:手机编程编辑器 编辑:程序博客网 时间:2024/06/05 21:53

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

问题出现背景:

从本地数据文件载入数据表

数据文件:qqq,aaaccc,rrrr建表语句:CREATE EXTERNAL TABLE `dwh_tag_convert_dict`(  `obj` string,   `tag` string)PARTITIONED BY(p_type string)row format delimited fields terminated by ','STORED AS rcfile LOCATION 'hdfs://dg-namenode1:9000/user/hive/warehouse/dg/tables/dwh_tag_convert_dict';原因:装载以逗号为分割的本地数据文件时,指定的存储文件格式应为 textFile, 而不是rcfile

解决办法:

修改为:STORED AS textfile LOCATION 'hdfs://dg-namenode1:9000/user/hive/warehouse/dg/tables/dwh_tag_convert_dict';