You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bogus SqlParser warning for valid TIMESTAMP literal #2570
The valid timestamp literal should be accepted, and no warning should be logged. The same problem does not appear with other SQL contexts, e.g. in a projection:
Note this also happens for DATE literals, and probably other types? E.g.
try (Statements = connection.createStatement()) {
try {
s.executeUpdate("create table t (i int, t Date, primary key (i)) engine = MergeTree()");
try (PreparedStatementp = connection.prepareStatement("insert into t (i, t) values (1, date '2010-01-01')")) {
System.out.println(p.executeUpdate());
}
}
finally {
s.executeUpdate("drop table if exists t");
}
}
N.B: I believe this SqlParser was introduced only recently? It appears to be nowhere near production ready. If you can, I suggest reverting its use in the JDBC driver for now, or enabling it only in an experimental mode. As suggested by this issue, the parser's false positives do appear to have a significant impact on executed queries:
Surely, you should have a large set of ClickHouse server test queries available that you can use just to smoke test your SqlParser. Anything that is accepted by the server should be accepted by the JDBC driver.
@lukaseder
Thank you for the feedback!
yes, we have used an antlr4 recently to replace previous javacc implementation (it had some other issues with maintenance).
We will work on mitigating these issues.
Activity
lukaseder commentedon Sep 9, 2025
Note this also happens for
DATEliterals, and probably other types? E.g.N.B: I believe this
SqlParserwas introduced only recently? It appears to be nowhere near production ready. If you can, I suggest reverting its use in the JDBC driver for now, or enabling it only in an experimental mode. As suggested by this issue, the parser's false positives do appear to have a significant impact on executed queries:Surely, you should have a large set of ClickHouse server test queries available that you can use just to smoke test your
SqlParser. Anything that is accepted by the server should be accepted by the JDBC driver.chernser commentedon Sep 9, 2025
@lukaseder
Thank you for the feedback!
yes, we have used an antlr4 recently to replace previous javacc implementation (it had some other issues with maintenance).
We will work on mitigating these issues.
chernser commentedon Oct 27, 2025
Verified in
com.clickhouse.jdbc.internal.BaseSqlParserFacadeTest#testMiscStatements