alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.98k stars 8.59k forks source link

[BUG] 解析hive时如果 PARTITIONED BY 和 LOCATION 关键字之间有COMMENT解析失败 #6071

Open yeyeyuanyu opened 3 months ago

yeyeyuanyu commented 3 months ago

Database Type

hivi

Database Version

Druid Version

1.2.23

JDK Version

jdk8

Error SQL

CREATE TABLE IF NOT EXISTS test.dwr_whs_invt_dtl( bat_no string COMMENT '批号', ................................................. ) USING hudi PARTITIONED BY (acct_prd string comment '会计期') COMMENT '明细表' LOCATION 'obs://xxxxxxxxxxxxxxxxxx' TBLPROPERTIES ( type = 'mor', primaryKey = 'acct_prd' , preCombineField = 'acct_prd' );

Testcase Code

No response

Stacktrace Info

No response

Error Info

No response

yeyeyuanyu commented 3 months ago

Exception in thread "main" com.alibaba.druid.sql.parser.ParserException: not supported.pos 973, line 27, column 82, token IDENTIFIER LOCATION at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:654) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:600) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:621)

yeyeyuanyu commented 3 months ago

CREATE TABLE IF NOT EXISTS dwi.dwi_wms_addr ( ............................................. dwi_last_ins_time STRING COMMENT 'DWI数据插入时间', dwi_last_upd_time STRING COMMENT 'DWI数据更新时间' ) USING hudi COMMENT '货位表' LOCATION 'obs://xxxxxxxxxxxxxxxxxxxxxxx' ---HUDI表存储路径 OPTIONS ( xxxxxxxxxxxxxxxxxxxxxxxxxxxxx ); 还有可能无法解析options Exception in thread "main" com.alibaba.druid.sql.parser.ParserException: not supported.pos 2578, line 70, column 2, token IDENTIFIER OPTIONS at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:654) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:600) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:621)

yeyeyuanyu commented 3 months ago

PARTITIONED BY 在 LOCATION 后面也会失败