Skip to content

[SQL] Advance Calcite version#5696

Merged
mihaibudiu merged 2 commits intomainfrom
calcite
Feb 26, 2026
Merged

[SQL] Advance Calcite version#5696
mihaibudiu merged 2 commits intomainfrom
calcite

Conversation

@mihaibudiu
Copy link
Contributor

Advance Calcite version to pick up recent commits.

Fixes #5637

I have upstreamed a small fix which enables us to undo a complicated workaround a Calcite bug for TUMBLE and HOP functions. A second commit thus essentially reverts #5576

Describe Manual Test Plan

Ran all Java tests

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Copy link
Contributor

Copilot AI left a 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 pull request advances the Calcite version to pick up recent upstream commits that fix a type inference issue with the CONTAINS operator. The PR also removes a complex workaround for a Calcite bug related to TUMBLE and HOP window functions, reverting changes from PR #5576 now that the fix has been upstreamed.

Changes:

  • Updates Calcite commit hash from ea08b43db6bc83ea76678bd77873e110083c0edc to e7e3925cf1bcd8d71b664fe295705c1180f89c3a in calcite_version.env
  • Removes custom implementations of window table functions (FelderaSqlWindowTableFunction, FelderaSqlTumbleTableFunction, FelderaSqlHopTableFunction) now that Calcite properly handles unlimited precision timestamps
  • Updates test for issue #5637 to verify that incompatible types in CONTAINS operator are properly rejected by Calcite

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
sql-to-dbsp-compiler/calcite_version.env Updates Calcite commit hash to pick up upstream fixes
sql-to-dbsp-compiler/SQL-compiler/src/test/java/org/dbsp/sqlCompiler/compiler/sql/simple/Regression2Tests.java Updates issue5637 test to verify proper error message for incompatible types in CONTAINS operator
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/SqlToRelCompiler.java Removes ReplaceTumbleHop shuttle class that was workaround for Calcite bug
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/FelderaSqlWindowTableFunction.java Deletes custom window table function base class (no longer needed)
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/FelderaSqlTumbleTableFunction.java Deletes custom TUMBLE implementation (no longer needed)
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/FelderaSqlHopTableFunction.java Deletes custom HOP implementation (no longer needed)
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/CustomFunctions.java Removes registration of custom window functions
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/ConvertletTable.java Changes parameter type from FelderaSqlWindowTableFunction to SqlWindowTableFunction
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/CalciteToDBSPCompiler.java Simplifies function name matching using switch statement, removes custom function name checks
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/DBSPCompiler.java Removes error message rewriting for custom window functions

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Copy link
Collaborator

@mythical-fred mythical-fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Net -476 lines. This is the best kind of PR.

Upstreaming the timestamp precision fix to Calcite and reverting the workaround is exactly the right move — the custom FelderaSqlTumbleTableFunction/FelderaSqlHopTableFunction classes, the ReplaceTumbleHop AST shuttle, and the error-message rewriting for feldera_hop/feldera_tumble were all there to paper over a Calcite bug. Now that the bug is fixed upstream, none of it needs to exist.

The issue5637 test going from @Ignore to a proper statementsFailingInCompilation assertion is the right signal — the fix is now verified, not assumed.

@mihaibudiu mihaibudiu changed the title Calcite [SQL] Advance Calcite version Feb 25, 2026
@mihaibudiu mihaibudiu enabled auto-merge February 25, 2026 17:54
@mihaibudiu mihaibudiu added this pull request to the merge queue Feb 26, 2026
@rivudhk rivudhk removed this pull request from the merge queue due to a manual request Feb 26, 2026
@mihaibudiu mihaibudiu added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 17db567 Feb 26, 2026
3 checks passed
@mihaibudiu mihaibudiu deleted the calcite branch February 26, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SQL] Comparison using CONTAINS on incompatible types fails with error[E0277]

4 participants