prestodb/presto · error · PrestoException
GENERIC_INTERNAL_ERROR
GENERIC_INTERNAL_ERROR
Error message
Error getting UserDefinedType: %s
What it means
AbstractSqlInvokedFunctionNamespaceManager.getUserDefinedType wraps any non-NOT_FOUND exception thrown by the underlying UDT fetch into a GENERIC_INTERNAL_ERROR PrestoException. It is a server-side wrapper meaning 'the catalog asked for a user-defined type and something went wrong that was not simply type-not-found'. The original cause is attached, so the root reason is in the cause chain.
Source
Thrown at presto-function-namespace-managers-common/src/main/java/com/facebook/presto/functionNamespace/AbstractSqlInvokedFunctionNamespaceManager.java:188
return fetchFunctionsDirect(functionName);
}
@Override
public Optional<UserDefinedType> getUserDefinedType(QualifiedObjectName typeName)
{
try {
return Optional.of(userDefinedTypes.getUnchecked(typeName));
}
catch (UncheckedExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof PrestoException) {
PrestoException prestoException = (PrestoException) cause;
if (prestoException.getErrorCode().equals(NOT_FOUND.toErrorCode())) {
return Optional.empty();
}
throw prestoException;
}
throw new PrestoException(GENERIC_INTERNAL_ERROR, format("Error getting UserDefinedType: %s", typeName), cause);
}
}
@Override
public FunctionHandle getFunctionHandle(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, Signature signature)
{
checkCatalog(signature.getName());
// This is the only assumption in this class that we're dealing with sql-invoked regular function.
SqlFunctionId functionId = new SqlFunctionId(signature.getName(), signature.getArgumentTypes());
if (transactionHandle.isPresent()) {
return transactions.get(transactionHandle.get()).getFunctionHandle(functionId);
}
FunctionCollection collection = new FunctionCollection();
collection.loadAndGetFunctionsTransactional(signature.getName());
return collection.getFunctionHandle(functionId);
}
@OverrideView on GitHub (pinned to 55bb57d202)
Solutions
- Inspect the attached cause of the PrestoException to find the real failure (network, auth, decode) and fix that root issue.
- Verify the function namespace manager is configured and reachable (endpoint, credentials).
- Confirm the UDT exists and is fully registered; retry after the backing store is healthy.
- Check for version skew between coordinator and namespace manager that could break UDT deserialization.
Example fix
// before
Type udt = namespaceManager.getUserDefinedType(typeName);
// after
try {
Type udt = namespaceManager.getUserDefinedType(typeName);
} catch (PrestoException e) {
if (e.getCause() != null) {
log.error("UDT lookup failed for %s", e.getCause());
}
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check that the UDT is registered by listing known types, if the manager exposes them
boolean known = namespaceManager.listUserDefinedTypes().stream()
.anyMatch(t -> t.equals(typeName)); Type guard
boolean isResolvableUdt(String typeName) {
try {
namespaceManager.getUserDefinedType(typeName);
return true;
} catch (PrestoException e) {
return false;
}
} Try / catch
try {
Type type = namespaceManager.getUserDefinedType(typeName);
} catch (PrestoException e) {
Throwable root = e.getCause();
// fall back to base type handling or fail with the root cause surfaced
} Prevention
- Keep the function namespace store reachable and monitored.
- Register UDTs atomically so partially-written types are never queried.
- Always inspect getCause() when wrapping server exceptions.
- Pin matching versions between coordinator and namespace manager plugins.
When it happens
Trigger: Calling getUserDefinedType(typeName) on a SQL-invoked function namespace manager when the backing delegate throws any exception other than NOT_FOUND (e.g. connection failure, permission denial, serialization error while resolving the UDT).
Common situations: Remote function-namespace store outage or misconfigured endpoint; the delegate raising an unexpected exception (auth failure, schema corruption); querying a UDT whose registration is partially written or incompatible after a version upgrade.
Related errors
- VIEW_NOT_FOUND
- Only one of 'case-insensitive-name-matching=true' or 'case-s
- connection-url is required but was not provided
- Unsupported java type %s
- CLICKHOUSE_QUERY_GENERATOR_FAILURE
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/74ea7cf7bf024b90.
Report an issue: GitHub.