From a4162df7ea3d82c548fd1a0395cf7d6bc918dac1 Mon Sep 17 00:00:00 2001 From: Polyglot AI <293096396+polyglotAI-bot@users.noreply.github.com> Date: Sat, 17 Oct 2026 00:37:41 +0000 Subject: [PATCH] jdbc-v2: update keywords and engines in JDBC ClickHouse 26.11 (HEAD) adds the `TIME RANGES` keyword and the `Obfuscate` table engine. The jdbc-v2 keyword and engine guard tests fail because `RANGES` is not in ALLOWED_KEYWORD_ALIASES and `Obfuscate` is not in ENGINE_TO_TABLE_TYPE. - Append `RANGES` to ALLOWED_KEYWORD_ALIASES. It is usable as an alias on the server (`SELECT 1 RANGES`). - Map `Obfuscate` to TABLE, the same as the other engines that only produce data (GenerateRandom, FuzzJSON, FuzzQuery). The engine only backs the `obfuscate` table function; the server rejects it in CREATE TABLE. Fixes: https://github.com/ClickHouse/clickhouse-java/issues/3222 Co-Authored-By: Claude Opus 5.5 --- history/latest/3222.md | 5 +++++ .../jdbc/internal/parser/javacc/ClickHouseSqlUtils.java | 4 +++- .../com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 history/latest/3222.md diff --git a/history/latest/3222.md b/history/latest/3222.md new file mode 100644 index 000000000..83117050e --- /dev/null +++ b/history/latest/3222.md @@ -0,0 +1,5 @@ +- **[jdbc-v2]** Added the `RANGES` keyword (part of the new `TIME RANGES` keyword) and the `Obfuscate` table engine + from ClickHouse 26.11 (HEAD) to the driver's keyword and engine lists, so the keyword and table-engine checks pass + against ClickHouse HEAD. There is no behavior change: both SQL parsers already accept `RANGES` as an alias, and + `DatabaseMetaData#getTables` already reports an unmapped engine as `TABLE`, which is the type that `Obfuscate` now + maps to. (https://github.com/ClickHouse/clickhouse-java/issues/3222) 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 f73b27bc7..4a36f74a9 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 @@ -79,7 +79,9 @@ private static Set initAllowedKeywordAliases() { // Appended 09/29/2026 "FAMILIES", "INCREMENTAL", "METRIC", "PROJECTIONS", "TOKEN", // Appended 10/05/2026 - "LATERAL", "SIMILAR" + "LATERAL", "SIMILAR", + // Appended 10/17/2026 + "RANGES" ); } diff --git a/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java b/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java index 268f892b0..f6e046b01 100644 --- a/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java +++ b/jdbc-v2/src/main/java/com/clickhouse/jdbc/metadata/DatabaseMetaDataImpl.java @@ -921,6 +921,9 @@ public ResultSet getProcedureColumns(String catalog, String schemaPattern, Strin map.put("Remote", TableType.REMOTE_TABLE.getTypeName()); map.put("RemoteSecure", TableType.REMOTE_TABLE.getTypeName()); + // Obfuscate (appended 10/17/2026) + map.put("Obfuscate", TableType.TABLE.getTypeName()); + // Special map.put("TimeSeries", TableType.TABLE.getTypeName()); map.put("Null", TableType.TABLE.getTypeName());