Cloudera Hue-无法识别Serde属性规范中'WITH''SERDEPROPERTIES''('附近的输入

时间:2018-07-18 11:16:41

标签: hive ddl hive-serde

我正在尝试创建此表:

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");

但是我遇到了一个问题:

  

编译语句时出错:失败:ParseException行14:2   无法识别Serde中'WITH''SERDEPROPERTIES''('附近的输入   属性规范

我该如何解决?

谢谢!

1 个答案:

答案 0 :(得分:0)

行格式应指定一次,并在最后一列后删除多余的逗号

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");