Open debychkov opened 2 years ago
Thanks @debychkov. You can use parenthesis as a workaround. The loose parser also problem dealing with case ... when as mentioned in #723. It's not worthy of implementing a fully functional parser on client side, so the current plan is to move the parser to clickhouse-jdbc-ext
, which is a new module for extended functions over clickhouse-jdbc
like SQL templating(which will simplify queries using JDBC table function). And use same approach at here for parsing.
Despite having fallback on sending unparsed sql "as is" and successful server query, it may lead to losing FORMAT clause, and thus exceptions when parsing server response.
You're right. But the issue is only limited to legacy driver. In new driver, X-ClickHouse-Format
http header is used instead.
Minimal example:
Clickhouse command line client accepts this query:
Note: I'm still on the legacy driver, but it seems unimportant - parser is same for both drivers. But there is something - I'm not sure, how it will behave with new driver, but in legacy it can still cause problems. Despite having fallback on sending unparsed sql "as is" and successful server query, it may lead to losing FORMAT clause, and thus exceptions when parsing server response.