0

我正在尝试创建此表:

CREATE TABLE
    TABLE_DATA
    (
        A STRING,
        B STRING,
        C STRING,
        D STRING,
        E STRING,
        F STRING,
        G STRING,
        H STRING,
    )
    ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
    ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
    WITH SERDEPROPERTIES 
    (
       "separatorChar" = ",",
       "quoteChar"     = "\""
    )       
    STORED AS TEXTFILE LOCATION '...'
    TBLPROPERTIES ("skip.header.line.count"="1");

但是我遇到了一个问题:

编译语句时出错:FAILED: ParseException line 14:2 cannot identify input near 'WITH' 'SERDEPROPERTIES' '(' in serde properties specification

我该如何解决?

谢谢!

4

1 回答 1

0

ROW FORMAT 应指定一次,并在最后一列后删除多余的逗号

CREATE TABLE TABLE_DATA
            (
                    A STRING,
                    B STRING,
                    C STRING,
                    D STRING,
                    E STRING,
                    F STRING,
                    G STRING,
                    H STRING
            )
            ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
            WITH SERDEPROPERTIES 
            (
               "separatorChar" = ",",
               "quoteChar"     = "\""
            )       
            LOCATION '...'
            TBLPROPERTIES ("skip.header.line.count"="1");
于 2018-07-18T11:44:43.277 回答