From 56c6d0c02251219d928cfcf66109940d01e058f2 Mon Sep 17 00:00:00 2001 From: Polyglot AI <293096396+polyglotAI-bot@users.noreply.github.com> Date: Thu, 10 Sep 2026 07:53:17 +0000 Subject: [PATCH] jdbc-v2: allow new ClickHouse keywords in identifier positions ClickHouse 26.8 adds the non-reserved keywords AGGREGATE, BOUNDED, EXTEND, HANDLER, PROTOCOL, UNORDERED and the multi-word keywords IDLE TIMEOUT and RECENT SAMPLES to system.keywords. None of them were listed in ALLOWED_KEYWORD_ALIASES, so StatementSQLTest#testAllowedKeywordAliasesMatchSystemKeywords failed against the latest server. The server accepts every one of them as a column or table alias, so they belong in the allowed-alias list rather than in reserved_keywords.txt. Fixes: https://github.com/ClickHouse/clickhouse-java/issues/3113 --- CHANGELOG.md | 5 +++++ .../jdbc/internal/parser/javacc/ClickHouseSqlUtils.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b264b9415..4d2a32b51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -153,6 +153,11 @@ ### Bug Fixes +- **[jdbc-v2]** Added the non-reserved keywords `AGGREGATE`, `BOUNDED`, `EXTEND`, `HANDLER`, `IDLE`, `PROTOCOL`, + `RECENT`, `TIMEOUT` and `UNORDERED` (ClickHouse `26.8+`; `IDLE`, `TIMEOUT` and `RECENT` come from the multi-word + keywords `IDLE TIMEOUT` and `RECENT SAMPLES`) to the list of keywords allowed in identifier positions. The server + accepts all of them as a column or table alias, so a query using one of them as an identifier must parse. + (https://github.com/ClickHouse/clickhouse-java/issues/3113) - **[jdbc-v2, client-v2]** Fixes issue with `FORMAT` in query unable to override format set by client when used with ClickHouse 26.8+. Default format is `RowBinaryWithNamesAndTypes` set at client level. For JDBC, recommend using `format=JSONEachRow` to query JSON. Setting `format=` (empty or `null`) omits the format request header so explicit diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/parser/javacc/ClickHouseSqlUtils.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/parser/javacc/ClickHouseSqlUtils.java index 46277d196..98a8ac071 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/parser/javacc/ClickHouseSqlUtils.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/internal/parser/javacc/ClickHouseSqlUtils.java @@ -73,7 +73,9 @@ private static Set initAllowedKeywordAliases() { // Appended 06/26/2026 "ENUM", "HYPOTHETICAL", "WHATIF", // Appended 07/21/2026 - "ANALYZE", "AT", "MANIFEST", "RESERVATION" + "ANALYZE", "AT", "MANIFEST", "RESERVATION", + // Appended 09/10/2026 + "AGGREGATE", "BOUNDED", "EXTEND", "HANDLER", "IDLE", "PROTOCOL", "RECENT", "TIMEOUT", "UNORDERED" ); }