damccorm opened a new pull request, #39432: URL: https://github.com/apache/beam/pull/39432
## Backport from dataflow/beam-spark This backports commit [f53e1abe](https://source.corp.google.com/h/dataflow/beam-spark/+/f53e1abe163253ca358bd0fe121773f2f6bdf5e7) from the `dataflow/beam-spark` repository. ## Summary 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 `SqlOperator`s (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`**: Added `extraOperatorTable` field (a mutable `ListSqlOperatorTable`) and `getExtraOperatorTable()` getter. - **`CalciteQueryPlanner.java`**: Chained `connection.getExtraOperatorTable()` at the front of the `SqlOperatorTables.chain()` call in `defaultConfig()`. - **`BeamSqlEnv.java`**: Added `registerSqlOperator()` method that delegates to `connection.getExtraOperatorTable().add()`. - **`BeamSqlEnvRegisterOperatorTest.java`** (new): Tests verifying operators are added to the table, the table starts empty, and registered operators are resolvable by name. ## Files Changed - `sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/BeamSqlEnv.java` - `sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/CalciteQueryPlanner.java` - `sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/JdbcConnection.java` - `sdks/java/extensions/sql/src/test/java/org/apache/beam/sdk/extensions/sql/impl/BeamSqlEnvRegisterOperatorTest.java` (new) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
