【Hive】FAILED: ParseException line 24:17 extraneous input ';' expecting EOF near '<EOF>'
在hive命令中执行如下DDL
CREATE  TABLE store_test
(
    id                      bigint comment "PK",
    store_name_cn           string comment "store name",
    store_id                string comment "store id",
    store_activation_status smallint comment "store status(1-activate 2-forbidden)",
    country                 string comment "store country",
    province                string comment "store province",
    province_code           string comment "stores'province code",
    city                    string comment "store city",
    city_code               string comment "store's city code",
    address                 string comment "store address",
    telephone               string comment "store's telephone",
    postal_code             string comment "store's postal code",
    longitude               decimal(10, 7) comment "store's longitude",
    latitude                decimal(10, 7) comment "store's latitude",
    city_flagship           string comment "is the city flagship",
    national_flagship       string comment "is the national flagship",
    store_sort              smallint comment "the position of store",
    dept_id                 bigint comment "the department id",
    store_number           string comment "dkts poslo'g store number"
) comment "store"
    partitioned by (pt string)
    STORED AS ORC;
出现报错:
FAILED: ParseException line 24:17 extraneous input ';' expecting EOF near '<EOF>'
通过逐渐删减字段,定位到了问题原因是单引号 ' 的数量为奇数(是有点奇怪...)

解决办法:
对单引号进行转义

参考:

 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号