HIVE 载入本地数据文件报错

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,aaa
ccc,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';

你可能感兴趣的:(Hive)