prestodb/presto · error · IllegalStateException
Get function handle is not supported
Error message
Get function handle is not supported
What it means
getFunctionHandle() is an unsupported operation in the Hive function namespace manager. Signature-based function handle resolution is not implemented because Hive functions are resolved by qualified name plus parameter types via resolveFunction() instead. Throwing IllegalStateException makes accidental use fail fast.
Solutions
- Call resolveFunction(transactionHandle, functionName, parameterTypes) instead, which builds a HiveFunctionHandle.
- Reconstruct the QualifiedObjectName and parameter type list and resolve by name.
- If signature-based resolution is needed, register the function in a namespace that supports it or implement a custom manager.
Example fix
// before FunctionHandle h = manager.getFunctionHandle(txnHandle, signature); // after FunctionHandle h = manager.resolveFunction(txnHandle, qualifiedObjectName, parameterTypes);
Defensive patterns
Strategy: fallback
Validate before calling
if (manager instanceof HiveFunctionNamespaceManager) {
// use resolveFunction(txn, qualifiedName, parameterTypes) instead of getFunctionHandle(sig)
} Try / catch
try {
handle = manager.getFunctionHandle(txnHandle, signature);
} catch (IllegalStateException e) {
handle = manager.resolveFunction(txnHandle, qualifiedObjectName, parameterTypes);
} Prevention
- Always resolve Hive functions by qualified name plus parameter types.
- Keep the original QualifiedObjectName available when you might need a FunctionHandle.
- Add unit tests exercising resolution through the Hive namespace.
When it happens
Trigger: Calling getFunctionHandle(Optional<FunctionNamespaceTransactionHandle>, Signature) on HiveFunctionNamespaceManager, e.g. from generic engine code or a plugin that resolves functions by Signature.
Common situations: Migrating code that worked against other function namespaces which support signature-based resolution; test harnesses constructing FunctionHandles from raw signatures for Hive functions.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Get function is not supported
- dropping a table added/modified in the same transaction is…
- Execute function is not supported
- Inserting into an unpartitioned table that were added…
- User defined type is not supported
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/fef6d7c618078d5f.
Report an issue: GitHub.
Appendix: source
Thrown at presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/HiveFunctionNamespaceManager.java:146
public void dropFunction(QualifiedObjectName functionName, Optional<List<TypeSignature>> parameterTypes, boolean exists)
{
throw new IllegalStateException(format("Cannot drop function in hive function namespace: %s", functionName));
}
@Override
public Collection<HiveFunction> listFunctions(Optional<String> likePattern, Optional<String> escape)
{
return getCurrentFunctionNames().stream().map(functionName -> createDummyHiveFunction(functionName)).collect(toImmutableList());
}
public Collection<HiveFunction> getFunctions(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, QualifiedObjectName functionName)
{
throw new IllegalStateException("Get function is not supported");
}
public FunctionHandle getFunctionHandle(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, Signature signature)
{
throw new IllegalStateException("Get function handle is not supported");
}
public FunctionHandle resolveFunction(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, QualifiedObjectName functionName, List<TypeSignature> parameterTypes)
{
return new HiveFunctionHandle(initializeFunction(FunctionKey.of(functionName, parameterTypes)).getSignature());
}
public FunctionMetadata getFunctionMetadata(FunctionHandle functionHandle)
{
checkArgument(functionHandle instanceof HiveFunctionHandle);
HiveFunction function = functions.getUnchecked(FunctionKey.from((HiveFunctionHandle) functionHandle));
return function.getFunctionMetadata();
}
public ScalarFunctionImplementation getScalarFunctionImplementation(FunctionHandle functionHandle)
{
checkArgument(functionHandle instanceof HiveFunctionHandle);
HiveFunction function = functions.getUnchecked(FunctionKey.from((HiveFunctionHandle) functionHandle));View on GitHub (pinned to 55bb57d202)