存储为 CSV Hive 子句的文件格式无法识别

Unrecognized file format in stored as clause CSV Hive

我正在尝试在 S3 中创建一个 csv 配置单元 table(使用 Hive CLI)。

create external table hello (
name INT)
stored as csv
location 's3://bucket/myfolder;

==> 错误 SemanticException Unrecognized file format in stored as clause 'CSV'

我删除了 EXTERNAL

create table hello (
name INT)
stored as csv
location 's3://bucket/myfolder;

==>同样的错误SemanticException Unrecognized file format in stored as clause 'CSV'

知道我正在使用 Apache Hive + Apache Hadoop(我安装它是因为 Hive 需要一些 hadoop 二进制文件)。

有什么想法吗,谢谢

CSV 不是有效的文件类型。试试这个:

create external table hello (
name INT)
row format delimited
fields terminated by ','
stored as textfile
location 's3://bucket/myfolder';

或者

create external table hello (
name INT)
row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
stored as textfile
location 's3://bucket/myfolder';