Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clickhouse sql 语句解析错误 #4043

Closed
kiwimg opened this issue Nov 15, 2020 · 3 comments
Closed

clickhouse sql 语句解析错误 #4043

kiwimg opened this issue Nov 15, 2020 · 3 comments
Labels
Milestone

Comments

@kiwimg
Copy link

kiwimg commented Nov 15, 2020

com.alibaba.druid.sql.parser.ParserException: ERROR. pos 632, line 25, column 62, token [
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:1127) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:95) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.exprList(SQLExprParser.java:1876) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.methodRest(SQLExprParser.java:1573) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.primaryRest(SQLExprParser.java:1349) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.dialect.clickhouse.parser.ClickhouseExprParser.primaryRest(ClickhouseExprParser.java:76) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.parseWhere(SQLSelectParser.java:676) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:443) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:372) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.select(SQLSelectParser.java:61) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:785) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:95) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.inRest(SQLExprParser.java:2625) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.relationalRest(SQLExprParser.java:3279) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.relational(SQLExprParser.java:3036) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLExprParser.andRest(SQLExprParser.java:2887) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.parseWhere(SQLSelectParser.java:672) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:443) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.query(SQLSelectParser.java:372) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLSelectParser.select(SQLSelectParser.java:61) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseSelect(SQLStatementParser.java:4119) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:204) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:113) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:153) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:126) ~[druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:156) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:657) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.filter.stat.StatFilter.statementPrepareAfter(StatFilter.java:320) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:124) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:568) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:341) [druid-1.2.2.jar:1.2.2]
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:351) [druid-1.2.2.jar:1.2.2]
at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1556) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:712) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:768) [spring-jdbc-5.1.18.RELEASE.jar:5.1.18.RELEASE]

@kiwimg
Copy link
Author

kiwimg commented Nov 15, 2020

druid 1.2.2 版本
执行的sql 如下
select * from data_all dsa where dsa.sign='1' and dsa.number in ( select DISTINCT number from dc_clients do where hasAny(splitByString(',',cast(do.df_time as String)),[?,?])=1 )

@wenshao wenshao added this to the 1.2.4 milestone Nov 15, 2020
@wenshao wenshao added the Bug label Nov 15, 2020
@kiwimg
Copy link
Author

kiwimg commented Nov 15, 2020

感谢

@wenshao
Copy link
Member

wenshao commented Dec 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants