{"record":{"id":"fef6d7c618078d5f","repo":"prestodb/presto","slug":"get-function-handle-is-not-supported","errorCode":null,"errorMessage":"Get function handle is not supported","messagePattern":"Get function handle is not supported","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/HiveFunctionNamespaceManager.java","lineNumber":146,"sourceCode":"    public void dropFunction(QualifiedObjectName functionName, Optional<List<TypeSignature>> parameterTypes, boolean exists)\n    {\n        throw new IllegalStateException(format(\"Cannot drop function in hive function namespace: %s\", functionName));\n    }\n\n    @Override\n    public Collection<HiveFunction> listFunctions(Optional<String> likePattern, Optional<String> escape)\n    {\n        return getCurrentFunctionNames().stream().map(functionName -> createDummyHiveFunction(functionName)).collect(toImmutableList());\n    }\n\n    public Collection<HiveFunction> getFunctions(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, QualifiedObjectName functionName)\n    {\n        throw new IllegalStateException(\"Get function is not supported\");\n    }\n\n    public FunctionHandle getFunctionHandle(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, Signature signature)\n    {\n        throw new IllegalStateException(\"Get function handle is not supported\");\n    }\n\n    public FunctionHandle resolveFunction(Optional<? extends FunctionNamespaceTransactionHandle> transactionHandle, QualifiedObjectName functionName, List<TypeSignature> parameterTypes)\n    {\n        return new HiveFunctionHandle(initializeFunction(FunctionKey.of(functionName, parameterTypes)).getSignature());\n    }\n\n    public FunctionMetadata getFunctionMetadata(FunctionHandle functionHandle)\n    {\n        checkArgument(functionHandle instanceof HiveFunctionHandle);\n        HiveFunction function = functions.getUnchecked(FunctionKey.from((HiveFunctionHandle) functionHandle));\n        return function.getFunctionMetadata();\n    }\n\n    public ScalarFunctionImplementation getScalarFunctionImplementation(FunctionHandle functionHandle)\n    {\n        checkArgument(functionHandle instanceof HiveFunctionHandle);\n        HiveFunction function = functions.getUnchecked(FunctionKey.from((HiveFunctionHandle) functionHandle));","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/HiveFunctionNamespaceManager.java#L128-L164","documentation":"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.","triggerScenarios":"Calling getFunctionHandle(Optional<FunctionNamespaceTransactionHandle>, Signature) on HiveFunctionNamespaceManager, e.g. from generic engine code or a plugin that resolves functions by Signature.","commonSituations":"Migrating code that worked against other function namespaces which support signature-based resolution; test harnesses constructing FunctionHandles from raw signatures for Hive functions.","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."],"exampleFix":"// before\nFunctionHandle h = manager.getFunctionHandle(txnHandle, signature);\n// after\nFunctionHandle h = manager.resolveFunction(txnHandle, qualifiedObjectName, parameterTypes);","handlingStrategy":"fallback","validationCode":"if (manager instanceof HiveFunctionNamespaceManager) {\n    // use resolveFunction(txn, qualifiedName, parameterTypes) instead of getFunctionHandle(sig)\n}","typeGuard":null,"tryCatchPattern":"try {\n    handle = manager.getFunctionHandle(txnHandle, signature);\n} catch (IllegalStateException e) {\n    handle = manager.resolveFunction(txnHandle, qualifiedObjectName, parameterTypes);\n}","preventionTips":["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."],"tags":["hive","function-namespace","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}