将csv导入impala

时间:2018-04-14 22:40:08

标签: sql impala

因此,对于我之前的作业,我们被要求将没有列名的csv文件导入impala,我们在创建表时明确给出每列的名称和类型。但是,现在我们有一个csv文件但是给出了列名,在这种情况下,我们是否还需要记下它的名称和类型,即使它是在数据中提供的?

1 个答案:

答案 0 :(得分:0)

是的,您仍然需要创建外部表并定义列名称和类型。但是你必须在create table语句

的末尾传递以下选项
tblproperties ("skip.header.line.count"="1");

-- Once the table property is set, queries skip the specified number of lines
-- at the beginning of each text data file. Therefore, all the files in the table
-- should follow the same convention for header lines.
相关问题