Page properties | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
private
final
Map<ObjectIdentifier, FunctionDefintion> tempFunctions =
new
LinkedHashMap<>();
Status
Current state: Under Discussion
Discussion thread: http://apache-flink-mailing-list-archive.1008284.n3.nabble.com/DISCUSS-FLIP-57-Rework-FunctionCatalog-td32291.html#a32613
JIRA: FLINK-14090
...
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
...
This FLIP would add explicit temporary function support by renaming a few variable names, and potential deprecating renaming some APIs in favor of new APIs that reflects their nature of dealing with temporary functions.
...
Their DDLs are “CREATE/DROP TEMPORARY SYSTEM FUNCTION”..
They will be renamed from Existing “registerScalar/Table/AggregateFunctions()” will be deprecated in favor of the new APIs.
b) Temporary Catalog Functions
...
Code Block | ||
---|---|---|
| ||
Class FunctionIdentifier { // for temporary/non-temporary system function // for temporary/non-temporary catalog function ObjectIdentifier oi; Optional<ObjectIdentifier> getIdentifier() {} Optional<String> getSimpleName( getName() {} Optional<FunctionIdentifier> of(ObjectIdentifier oi) {} Optional<FunctionIdentifier> of(String name) {} } |
Changes to CallExpression and UnresolvedCallExpression
...
Code Block | ||
---|---|---|
| ||
private final Map<String, FunctionDefintion> tempSystemFunctions = new LinkedHashMap<>(); private final Map<FunctionIdentifier, FunctionDefinition> tempFunctions = new LinkedHashMap<>(); public void registerTempSystemScalarFunction(String name, ScalarFunction function) { // put into tempSystemFunctions } public void registerTempSystemTableFunction(String name, TableFunction function) { // put into tempSystemFunctions } public void registerTempSystemAggregateFunction(String name, AggregateFunction function) { // put into tempSystemFunctions } public void registerTempCatalogScalarFunction(ObjectIdentifier foi, ScalarFunction function) { // put into tempFunctions } public void registerTempCatalogTableFunction(ObjectIdentifier fi, TableFunction function) { // put into tempFunctions } public void registerTempCatalogAggregateFunction(ObjectIdentifier fi, AggregateFunction function) { // put into tempFunctions } public void dropTemporarySystemFunction(String name) {} public void dropTemporaryFunctiondropTemporaryCatalogFunction(FunctionIdentifier fi) {} public Optional<FunctionLookup.Result> lookupFunction(FunctionIdentifier fi) { if (fi.getObjectIdentifier().isPresent()) { // resolvePreciseFunctionReference(fi.getObjectIdentifier()); } else { resolveAmbiguousFunctionReference(fi.getName()); } } private Optional<FunctionLookup.Result> resolvePreciseFunctionReference(FunctionIdentifier fi) { // resolve order: // 1. Temporary functions // 2. Catalog functions } private Optional<FunctionLookup.Result> resolveAmbiguousFunctionReference(String name); // resolve order: // 1. Temporary system functions // 2. Builtin functions // 3. Temporary functions, in the current catalog/db // 2. Catalog functions, in the current catalog/db } |
...