use of com.facebook.presto.spi.function.FunctionNamespaceManager in project presto by prestodb.
the class FunctionAndTypeManager method getUserDefinedType.
private Type getUserDefinedType(TypeSignature signature) {
Optional<FunctionNamespaceManager<?>> functionNamespaceManager = getServingFunctionNamespaceManager(signature.getTypeSignatureBase());
checkArgument(functionNamespaceManager.isPresent(), "Cannot find function namespace for type '%s'", signature.getBase());
UserDefinedType userDefinedType = functionNamespaceManager.get().getUserDefinedType(signature.getTypeSignatureBase().getTypeName()).orElseThrow(() -> new IllegalArgumentException("Unknown type " + signature));
checkArgument(userDefinedType.getPhysicalTypeSignature().getTypeSignatureBase().hasStandardType(), "A UserDefinedType must be based on static types.");
return getType(userDefinedType);
}
Aggregations