从hdfs到配置单元的Csv文件摄取

从hdfs到配置单元的Csv文件摄取,csv,hadoop,hive,hiveql,Csv,Hadoop,Hive,Hiveql,我正在尝试使用下面的命令将csv文件从我的hdfs摄取到配置单元 create table test (col1 string, col2 int, col3 string) ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES ("separatorChar" = ",","quoteChar" = "\"") stored as textfile; alter table tes

我正在尝试使用下面的命令将csv文件从我的hdfs摄取到配置单元

create table test (col1 string, col2 int, col3 string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES ("separatorChar" = ",","quoteChar" = "\"")
stored as textfile;
alter table test
set TBLPROPERTIES ('skip.header.line.count'='1','serialization.null.format' = '');
但是我的配置单元表中仍然有双引号,所以我尝试了下面的命令

create table test (col1 string, col2 int, col3 string)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES ("separatorChar" = ",","quoteChar" = "\"")
stored as textfile;
alter table test
set TBLPROPERTIES ('skip.header.line.count'='1','serialization.null.format' = '');

但还是有双引号。如何删除这些双引号?

您需要指定文件位置。
例如:
创建表测试(col1字符串、col2 int、col3字符串)
行格式SERDE'org.apache.hadoop.hive.serde2.OpenCSVSerde'
具有SerdeProperty(“分离器CHAR”=“,”)
存储为文本文件
位置'hdfs://:8020/hdfs/path/to/csv/files dir'

以这种方式创建表时,表中的值没有引号(源csv文件确实有)

您需要指定文件位置。
例如:
创建表测试(col1字符串、col2 int、col3字符串)
行格式SERDE'org.apache.hadoop.hive.serde2.OpenCSVSerde'
具有SerdeProperty(“分离器CHAR”=“,”)
存储为文本文件
位置'hdfs://:8020/hdfs/path/to/csv/files dir'
以这种方式创建表时,表中的值没有引号(源csv文件确实有引号)