Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Page properties


Discussion thread
Vote thread
JIRA

Jira
serverASF JIRA
serverId5aa69414-a9e9-3523-82ec-879b028fb15b
keyFLINK-14090

Release1.10

private final Map<ObjectIdentifier, FunctionDefintion> tempFunctions = new LinkedHashMap<>();

Status

Current state: Under Discussion

Discussion threadhttp://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
languagejava
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
languagejava
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
}

...