Skip to content

[SQL] Advance Calcite; implement MAP_KEYS#4962

Merged
mihaibudiu merged 2 commits intomainfrom
issue4890
Oct 24, 2025
Merged

[SQL] Advance Calcite; implement MAP_KEYS#4962
mihaibudiu merged 2 commits intomainfrom
issue4890

Conversation

@mihaibudiu
Copy link
Copy Markdown
Contributor

Fixes #4890
Fixes #4891

In a separate commit it implements the MAP_KEYS function.

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Copilot AI review requested due to automatic review settings October 24, 2025 01:05
Copy link
Copy Markdown
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 PR advances the Apache Calcite version to 1.41.0 and implements the MAP_KEYS SQL function. The Calcite update fixes two regression issues related to ROW type comparisons (#4890, #4891).

Key changes:

  • Updates Calcite commit hash to version 1.41.0
  • Implements MAP_KEYS function to extract map keys as a sorted array
  • Adds validation to prevent NULL types as map keys

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sql-to-dbsp-compiler/calcite_version.env Updates Calcite commit hash to newer version
sql-to-dbsp-compiler/SQL-compiler/src/test/java/org/dbsp/sqlCompiler/compiler/sql/simple/Regression1Tests.java Adds regression tests for issues #4890 and #4891
sql-to-dbsp-compiler/SQL-compiler/src/test/java/org/dbsp/sqlCompiler/compiler/sql/simple/MapTests.java Adds tests for MAP_KEYS function and NULL key validation
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/SqlToRelCompiler.java Adds emptyStatement() method for handling empty SQL statements
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/calciteCompiler/CalciteFunctions.java Registers MAP_KEYS function in the function catalog
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/TypeCompiler.java Adds NULL key type validation for maps
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/frontend/ExpressionCompiler.java Implements MAP_KEYS expression compilation
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/backend/rust/ToRustInnerVisitor.java Adds generic type parameters to cast_to_map function calls
sql-to-dbsp-compiler/SQL-compiler/src/main/java/org/dbsp/sqlCompiler/compiler/DBSPCompiler.java Calls emptyStatement() for empty SQL statements
docs.feldera.com/docs/sql/map.md Documents MAP_KEYS function usage
docs.feldera.com/docs/sql/function-index.md Adds MAP_KEYS to function index
crates/sqllib/src/map.rs Implements Rust functions for MAP_KEYS operation

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu mihaibudiu added this pull request to the merge queue Oct 24, 2025
Merged via the queue into main with commit c5557cd Oct 24, 2025
1 check passed
@mihaibudiu mihaibudiu deleted the issue4890 branch October 24, 2025 07:52
@mihaibudiu mihaibudiu mentioned this pull request Oct 24, 2025
10 tasks
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] BUG in operation: IN/NOT IN(ROW value) [SQL] IN/NOT IN(ROW literal) fails with error: operator must have compatible types

3 participants