-
Notifications
You must be signed in to change notification settings - Fork 614
[jdbc-v2] Parser issues fix #2506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes several parser grammar issues in the JDBC v2 driver to properly handle CTE (Common Table Expression) with unbound columns, IN expressions with parameters, and keyword aliases for time units.
- Adds support for CTE with unbound columns that can reference parameters
- Fixes parsing of IN expressions with parameter placeholders like "SELECT * FROM t WHERE v in (?)"
- Enables time unit keywords (YEAR, DAY, MONTH, HOUR, MINUTE, SECOND) to be used as aliases
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| ClickHouseParser.g4 | Updates grammar to support CTE unbound columns, UNION DISTINCT, and time unit keyword aliases |
| ParsedPreparedStatement.java | Adds handler for CTE unbound column parameters |
| SqlParserTest.java | Adds comprehensive test cases for new grammar features |
| PreparedStatementTest.java | Adds integration tests for CTE and IN clause functionality |
jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/ClickHouseParser.g4
Outdated
Show resolved
Hide resolved
Client V2 CoverageCoverage Report
Class Coverage
|
JDBC V2 CoverageCoverage Report
Class Coverage
|
JDBC V1 CoverageCoverage Report
Class Coverage
|
Client V1 CoverageCoverage Report
Class Coverage
|
|



Summary
This PR does fixes in parser grammar to handle:
Closes #2500
Closes #2493
Closes #2478
Closes #2504
Checklist
Delete items not relevant to your PR: