Support setting a schema name with @ScalarFunction annotation#24703
Support setting a schema name with @ScalarFunction annotation#24703ebyhr wants to merge 2 commits intotrinodb:masterfrom
@ScalarFunction annotation#24703Conversation
8d53593 to
cb46961
Compare
cb46961 to
d2ac6b5
Compare
d2ac6b5 to
552f5b2
Compare
552f5b2 to
66a965d
Compare
|
Can you explain the function resolution rules when both systems (new class based and existing metadata lookup) are used? |
|
This would be useful for #24963, but that is more complicated as it needs a way for the connector to provide an instance of the function class, as the instance needs dependencies injected. Something to consider -- we don't need to solve that here. |
| .map(function -> new CatalogFunctionMetadata(catalogHandle, name.getSchemaName(), function)) | ||
| .forEach(functions::add); | ||
|
|
||
| scalarFunctionRegistry.listFunctions(catalogHandle, name.getSchemaName()).stream() |
There was a problem hiding this comment.
Is it possible to provide all functions from a connector in a uniform way?
Here we have two separate mechanisms for the existing connector-provided functions and the new annotation-based connector-provided functions.
It makes the code complicated, and It is brittle in that the precedence is important.
For example here in MetadataManager we first list the "traditional" functions, and then the "new" functions.
However in FunctionManager.getScalarFunctionImplementationInternal, we first check the "new" functions.
If there is a duplicate, it could lead to a mismatch.
|
Closing as we already added Iceberg bucket function in #25175. |
Description
Add
schemato@ScalarFunctionso developers can implement catalog functions with the annotation.Window functions, aggregate functions, and scalar operators are unsupported in this PR. I will support them once we agree on the approach.
This is preparation for #24200
Release notes