Add registerSqlOperator() to BeamSqlEnv for custom SQL operators#39432
Open
damccorm wants to merge 1 commit into
Open
Add registerSqlOperator() to BeamSqlEnv for custom SQL operators#39432damccorm wants to merge 1 commit into
damccorm wants to merge 1 commit into
Conversation
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
damccorm
force-pushed
the
backport-f53e1abe-register-sql-operator
branch
3 times, most recently
from
July 22, 2026 15:16
6613513 to
4becd31
Compare
Backports commit f53e1abe from dataflow/beam-spark. Adds a mutable, session-scoped ListSqlOperatorTable (extraOperatorTable) to JdbcConnection, chained at the front of the planner's operator table in CalciteQueryPlanner.defaultConfig. This allows registering custom SqlOperators (e.g. with VARIADIC operand checkers) that cannot be expressed through the schema-function auto-wrapping path. Adds BeamSqlEnvRegisterOperatorTest with tests verifying: - Operators are added to the extra operator table - Table starts empty on fresh env - Registered operators are resolvable by name
damccorm
force-pushed
the
backport-f53e1abe-register-sql-operator
branch
from
July 22, 2026 16:06
4becd31 to
e5c1967
Compare
damccorm
marked this pull request as ready for review
July 22, 2026 17:00
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Author
|
R: @Abacn |
Contributor
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
Abacn
reviewed
Jul 23, 2026
| * built are visible. | ||
| */ | ||
| private final org.apache.beam.vendor.calcite.v1_40_0.org.apache.calcite.sql.util | ||
| .ListSqlOperatorTable |
Contributor
There was a problem hiding this comment.
(formatting) import the names
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
Adds a mutable, session-scoped
ListSqlOperatorTable(extraOperatorTable) toJdbcConnection, chained at the front of the planner's operator table inCalciteQueryPlanner.defaultConfig. This allows registering customSqlOperators (e.g. with VARIADIC operand checkers) that cannot be expressed through the schema-function auto-wrapping path (which always produces a fixed-parameter checker).Changes
JdbcConnection.java: AddedextraOperatorTablefield (a mutableListSqlOperatorTable) andgetExtraOperatorTable()getter.CalciteQueryPlanner.java: Chainedconnection.getExtraOperatorTable()at the front of theSqlOperatorTables.chain()call indefaultConfig().BeamSqlEnv.java: AddedregisterSqlOperator()method that delegates toconnection.getExtraOperatorTable().add().BeamSqlEnvRegisterOperatorTest.java(new): Tests verifying operators are added to the table, the table starts empty, and registered operators are resolvable by name.