-
Notifications
You must be signed in to change notification settings - Fork 97
[SQL] Advance Calcite version; convert all input types to the result type in an INTERSECT operation #5490
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
Signed-off-by: Mihai Budiu <[email protected]>
…type in an INTERSECT operation Signed-off-by: Mihai Budiu <[email protected]>
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 updates the Calcite version and fixes type conversion issues in INTERSECT operations by ensuring all input types are properly converted to the result type.
Changes:
- Advances the Calcite commit to version
ea08b43db6bc83ea76678bd77873e110083c0edc - Refactors INTERSECT operation handling to convert input types to the result type during indexing
- Adds regression tests for issues #5425 (DESCRIPTOR with array indexing) and #5484 (INTERSECT with user-defined types)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| calcite_version.env | Updates the Calcite commit hash to the next version |
| Regression2Tests.java | Adds two new regression tests for the fixed issues |
| CalciteToDBSPCompiler.java | Refactors INTERSECT logic by extracting indexEntireTuple method and converting input types to result type during indexing |
| /** Given an operator with output type ZSet[T], index is using | ||
| * (ZSet[S], Tup0). */ |
Copilot
AI
Jan 22, 2026
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.
The documentation comment is unclear. It should explain that this method indexes a ZSet by its entire tuple as the key, converting from input type S to result type T, and producing an indexed ZSet with an empty value tuple (Tup0).
| /** Given an operator with output type ZSet[T], index is using | |
| * (ZSet[S], Tup0). */ | |
| /** | |
| * Given an operator whose output is a {@code ZSet<S>}, create an indexed ZSet that | |
| * uses the entire tuple as the key and an empty tuple ({@code Tup0}) as the value. | |
| * <p> | |
| * The input tuples of type {@code S} are cast to {@code resultType} (type {@code T}) | |
| * and used as the key type of the resulting {@code IndexedZSet<T, Tup0>}. | |
| */ |
| @Test | ||
| public void issue5425() { | ||
| this.statementsFailingInCompilation(""" | ||
| CREATE TABLE tbl( |
Copilot
AI
Jan 22, 2026
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.
Extra space between 'TABLE' and 'tbl' should be removed.
| CREATE TABLE tbl( | |
| CREATE TABLE tbl( |
Fixes #5425
Fixes #5484