Search before asking
Fluss version
main (development)
Please describe the bug 馃悶
FlinkCatalog currently ignores the database component when resolving the built-in bitmap functions:
listFunctions(String dbName) always returns BUILTIN_BITMAP_FUNCTIONS.
functionExists(ObjectPath) only checks the function name.
getFunction(ObjectPath) only checks the function name.
As a result, a fully qualified reference can resolve even when its database does not exist:
SELECT fluss_catalog.nonexistent.rb_build(ARRAY[1, 2]);
This is inconsistent with the database-scoped semantics of Flink catalog functions. It also makes it impossible to guarantee that the database component of <catalog>.<database>.<function> identifies an existing database.
The expected behavior is:
listFunctions(nonexistentDatabase) throws DatabaseNotExistException.
functionExists(nonexistentDatabase.function) returns false.
getFunction(nonexistentDatabase.function) throws FunctionNotExistException.
- Built-in functions continue to resolve from every existing database so that unqualified references work with the current Fluss catalog and database.
Solution
Validate the database before listing or resolving built-in functions in FlinkCatalog, and add unit/integration coverage for:
- Listing and resolving built-in functions from an existing database.
- Resolving a fully qualified built-in function from a nonexistent database.
- Calling a built-in function by its unqualified name after switching to a Fluss catalog/database.
Search before asking
Fluss version
main (development)
Please describe the bug 馃悶
FlinkCatalogcurrently ignores the database component when resolving the built-in bitmap functions:listFunctions(String dbName)always returnsBUILTIN_BITMAP_FUNCTIONS.functionExists(ObjectPath)only checks the function name.getFunction(ObjectPath)only checks the function name.As a result, a fully qualified reference can resolve even when its database does not exist:
This is inconsistent with the database-scoped semantics of Flink catalog functions. It also makes it impossible to guarantee that the database component of
<catalog>.<database>.<function>identifies an existing database.The expected behavior is:
listFunctions(nonexistentDatabase)throwsDatabaseNotExistException.functionExists(nonexistentDatabase.function)returnsfalse.getFunction(nonexistentDatabase.function)throwsFunctionNotExistException.Solution
Validate the database before listing or resolving built-in functions in
FlinkCatalog, and add unit/integration coverage for: