Versions Compared

Key

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

...

Code Block
languagejava
private final Map<String, FunctionDefintion> tempSystemFunctions = new LinkedHashMap<>();
private final Map<FunctionIdentifier, FunctionDefinition> tempFunctions = new LinkedHashMap<>();

public void registerTemporarySystemScalarFunction(String name, ScalarFunction function) {
// put into tempSystemFunctions
}

public void registerTemporarySystemTableFunction(String name, TableFunction function) {
// put into tempSystemFunctions

}

public void registerTemporarySystemAggregateFunction(String name, AggregateFunction function) {
// put into tempSystemFunctions

}

public void registerTemporaryScalarFunction(FunctionIdentifierObjectIdentifier foi, ScalarFunction function) {
// put into tempFunctions
}

public void registerTemporaryTableFunction(FunctionIdentifierObjectIdentifier fi, TableFunction function) {
// put into tempFunctions
}

public void registerTemporaryAggregateFunction(FunctionIdentifierObjectIdentifier fi, AggregateFunction function) {
// put into tempFunctions
}

public void dropTemporarySystemFunction(String name) {}

public void dropTemporaryFunction(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
}

...