Search in sources :

Example 1 with FunctionNamespaceManager

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);
}
Also used : FunctionNamespaceManager(com.facebook.presto.spi.function.FunctionNamespaceManager) UserDefinedType(com.facebook.presto.common.type.UserDefinedType)

Aggregations

UserDefinedType (com.facebook.presto.common.type.UserDefinedType)1 FunctionNamespaceManager (com.facebook.presto.spi.function.FunctionNamespaceManager)1