尝试将CSV文件导入配置单元时出错

egmofgnx  于 2023-05-11  发布在  其他
关注(0)|答案(1)|浏览(241)

我尝试将我的CSV数据导入到Hive
我的查询:

CREATE EXTERNAL TABLE student(Stud_name String,dept String,year String)
  > ROW FORMAT serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
  > with serdeproperties (
  >    "separatorChar" = ","
  > )
  > STORED AS TEXTFILE
  > LOCATION '/home/codewarrior/Desktop/csv';

但它给出了这个错误:

它退出Hive我该怎么解决?

7qhs6swi

7qhs6swi1#

你可以试试下面的代码:

CREATE EXTERNAL TABLE student(Stud_name String,dept String,year String) 
ROW FORMAT AS DELIMITED FIELDS TERMINATED by ',' location '/home/codewarrior/Desktop/csv';

相关问题