Interface Module
-
- All Known Implementing Classes:
CoreModule
@PublicEvolving public interface Module
Modules define a set of metadata, including functions, user defined types, operators, rules, etc. Metadata from modules are regarded as built-in or system metadata that users can take advantages of.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default Optional<FunctionDefinition>
getFunctionDefinition(String name)
Get an optional ofFunctionDefinition
by a given name.default Optional<DynamicTableSinkFactory>
getTableSinkFactory()
Returns aDynamicTableSinkFactory
for creating sink tables.default Optional<DynamicTableSourceFactory>
getTableSourceFactory()
Returns aDynamicTableSourceFactory
for creating source tables.default Set<String>
listFunctions()
List names of all functions in this module.default Set<String>
listFunctions(boolean includeHiddenFunctions)
List names of all functions in this module.
-
-
-
Method Detail
-
listFunctions
default Set<String> listFunctions()
List names of all functions in this module. It excludes internal functions.- Returns:
- a set of function names
-
listFunctions
default Set<String> listFunctions(boolean includeHiddenFunctions)
List names of all functions in this module.A module can decide to hide certain functions. For example, internal functions that can be resolved via
getFunctionDefinition(String)
but should not be listed by default.- Parameters:
includeHiddenFunctions
- whether to list hidden functions or not- Returns:
- a set of function names
-
getFunctionDefinition
default Optional<FunctionDefinition> getFunctionDefinition(String name)
Get an optional ofFunctionDefinition
by a given name.It includes hidden functions even though not listed in
listFunctions()
.- Parameters:
name
- name of theFunctionDefinition
.- Returns:
- an optional function definition
-
getTableSourceFactory
default Optional<DynamicTableSourceFactory> getTableSourceFactory()
Returns aDynamicTableSourceFactory
for creating source tables.A factory is determined with the following precedence rule:
- 1. Factory provided by the corresponding catalog of a persisted table.
- 2. Factory provided by a module.
- 3. Factory discovered using Java SPI.
This will be called on loaded modules in the order in which they have been loaded. The first factory returned will be used.
This method can be useful to disable Java SPI completely or influence how temporary table sources should be created without a corresponding catalog.
-
getTableSinkFactory
default Optional<DynamicTableSinkFactory> getTableSinkFactory()
Returns aDynamicTableSinkFactory
for creating sink tables.A factory is determined with the following precedence rule:
- 1. Factory provided by the corresponding catalog of a persisted table.
- 2. Factory provided by a module.
- 3. Factory discovered using Java SPI.
This will be called on loaded modules in the order in which they have been loaded. The first factory returned will be used.
This method can be useful to disable Java SPI completely or influence how temporary table sinks should be created without a corresponding catalog.
-
-