Open
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the jdbc-v2 SQL parser so SQL statements containing the ^ (caret) symbol can be tokenized and parsed correctly, addressing failures that led to incorrect hasResultSet detection (#2768).
Changes:
- Adds a new
^(<CARET>) token to the JavaCC grammar and treats it as a valid operator. - Extends dotted identifier parsing to allow optional
.^segments (e.g.,data.^header_index) in bothcolumnExpr()andnestedIdentifier(). - Adds regression tests covering
.^access, including a prepared-statement variant to ensure?parameter counting remains correct.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| jdbc-v2/src/main/javacc/ClickHouseSqlParser.jj | Adds <CARET> token and allows .^ segments in identifier paths; includes caret in operator set. |
| jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/BaseSqlParserFacadeTest.java | Adds parser facade regression cases for .^ identifier access and related statement parsing scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
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.



Summary
^Closes #2768
Checklist
Delete items not relevant to your PR:
Note
Low Risk
Small, localized JavaCC grammar update plus new regression tests; low risk but could affect edge-case parsing of dotted identifiers and operator tokenization.
Overview
Supports ClickHouse queries containing
^by adding aCARETtoken to the JavaCC grammar, recognizing it as anoperator(), and allowing.<CARET>?<identifier>in dotted identifier chains (e.g.,data.^header_index).Updates
BaseSqlParserFacadeTestwith regression cases fortoJSONString(data.^header_index)(with/without parameters) and expands the misc SQL corpus (e.g., extended JOIN alias syntax and token-related functions) to ensure parsing remains stable.Written by Cursor Bugbot for commit 3624efd. This will update automatically on new commits. Configure here.