Repository navigation
[jdbc-v2] Add RETURNING, SHARED keywords and Elasticsearch engine for ClickHouse HEAD - #3274
Merged
Merged
Conversation
Add the RETURNING and SHARED keywords to ALLOWED_KEYWORD_ALIASES and map the Elasticsearch table engine to REMOTE TABLE, so the keyword and table-engine checks pass against ClickHouse HEAD (26.11). Fixes: #3265 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
chernser
approved these changes
Oct 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fixes #3265.
ClickHouse 26.11 (HEAD) adds the non-reserved keywords
RETURNINGandSHAREDtosystem.keywordsand theElasticsearchengine tosystem.table_engines. The jdbc-v2 lists did not contain them, so two completeness tests failed against HEAD:StatementSQLTest.testAllowedKeywordAliasesMatchSystemKeywords:["RETURNING", "SHARED"]DatabaseMetaDataTest.testAllTableEnginesFromSystemTableEnginesAreMapped:[Elasticsearch]Because
Elasticsearchwas not mapped,DatabaseMetaData#getTablesused the defaultTABLEfor such a table, andgetTables(..., types = {"REMOTE TABLE"})did not return it.Changes
ClickHouseSqlUtils: addRETURNINGandSHAREDtoALLOWED_KEYWORD_ALIASESas a dated block. On the server both work as explicit and implicit aliases (SELECT 1 RETURNING,SELECT * FROM numbers(1) SHARED, ...), so they do not belong inreserved_keywords.txt. Neither word is a token in the JavaCC or ANTLR grammar, so both parsers already lex them as identifiers. This adds no parser behavior change.DatabaseMetaDataImpl: mapElasticsearchtoREMOTE TABLE. It is an external-storage engine, likeMongoDB,RedisandBigQuery.history/latest/3265.md: changelog entry.These edits follow
.cursor/skills/update-keyword-engine-lists.Test
No new test. The two completeness tests above are the regression tests for this class of omission. Run against ClickHouse
26.11.1.888(head):StatementSQLTest+DatabaseMetaDataTest58/58 andShowStatementDatabaseMetaDataTest93/93 pass.JavaCCParserTest,Antlr4ParserTestandAntlr4ParamsParserTestpass (1809/1809). This includestestKeywordAliasesAsTableNames, which parses everyALLOWED_KEYWORD_ALIASESentry as an explicit and an implicit alias.jdbc-v2unit suite passes (1963/1963).testTableTypesalready pins theREMOTE TABLEreporting and type filter, through the URL engine.Pre-PR validation gate
AGENTS.md,docs/changes_checklist.mdand.cursor/skills/update-keyword-engine-listshistory/latest/3265.md). No public-API ordocs/features.mdchange (list data only).Compatibility: the only user-visible change is that a table with the
Elasticsearchengine is now reported asREMOTE TABLEinstead ofTABLE.🤖 Generated with Claude Code
Note
Low Risk
List-only metadata updates with no parser or security changes; the only behavioral tweak is JDBC table-type reporting for Elasticsearch-engine tables.
Overview
Keeps jdbc-v2 in sync with ClickHouse 26.11 (HEAD) by extending the driver’s keyword-alias and table-engine lists (fixes #3265).
RETURNINGandSHAREDare added toALLOWED_KEYWORD_ALIASESinClickHouseSqlUtils, so integration checks againstsystem.keywordspass. This is list maintenance only—the JavaCC/ANTLR parsers already treat them as identifiers.The
Elasticsearchengine is mapped toREMOTE TABLEinDatabaseMetaDataImpl, alongside other external engines.DatabaseMetaData#getTablestherefore classifies Elasticsearch tables correctly and includes them when callers filter byREMOTE TABLEinstead of defaulting toTABLE.A changelog entry is added under
history/latest/3265.md.Reviewed by Cursor Bugbot for commit 7ac893b. Bugbot is set up for automated code reviews on this repo. Configure here.