[alibaba/druid]SQLUtils.parseStatements无法解析clickhouse语法GLOBAL JOIN

2025-11-10 744 views
9
版本

1.2.6

sql

select id from tableA t1 GLOBAL join tableB t2 on t1.id=t2.id

报错

Exception in thread "main" com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'id from tableA t1 global join tableB t2 on t1.id, pos 31, line 1, column 26, token GLOBAL at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:576) at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:602) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:565) at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:587) at io.terminus.dice.fdp.tagengine.utils.TsqlUtil.convertDruidChsql(TsqlUtil.java:112) at io.terminus.dice.fdp.tagengine.utils.TsqlUtil.main(TsqlUtil.java:124)

https://github.com/alibaba/druid/issues/3977显示1.2.2已解决,但是在1.2.6中还是无法解析clickhouse的global

回答

6

我使用https://github.com/alibaba/druid/issues/3977 的sql测试 结果:只支持GLOBAL IN;不支持:GLOBAL JOIN/LEFT JOIN等 @wenshao 麻烦大佬看下

2

1.2.8的版本已修复此问题

4

我的1.2.8版本仍然有这个问题