{"record":{"id":"d31a466d85fa1aee","repo":"prestodb/presto","slug":"execute-function-is-not-supported","errorCode":null,"errorMessage":"Execute function is not supported","messagePattern":"Execute function 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":172,"sourceCode":"    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));\n        checkState(function instanceof HiveScalarFunction);\n        return ((HiveScalarFunction) function).getJavaScalarFunctionImplementation();\n    }\n\n    @Override\n    public CompletableFuture<SqlFunctionResult> executeFunction(String source, FunctionHandle functionHandle, Page input, List<Integer> channels, TypeManager typeManager)\n    {\n        throw new IllegalStateException(\"Execute function is not supported\");\n    }\n\n    @Override\n    public void addUserDefinedType(UserDefinedType userDefinedType)\n    {\n        throw new IllegalStateException(\"User defined type is not supported\");\n    }\n\n    @Override\n    public Optional<UserDefinedType> getUserDefinedType(QualifiedObjectName typeName)\n    {\n        throw new IllegalStateException(\"User defined type is not supported\");\n    }\n\n    @Override\n    public boolean canResolveFunction()\n    {\n        return true;","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive-function-namespace/src/main/java/com/facebook/presto/hive/functions/HiveFunctionNamespaceManager.java#L154-L190","documentation":"executeFunction() is unsupported in the Hive function namespace: Hive functions are not executed remotely through the function-namespace execution path; their implementations are retrieved via specializedFunctionImplementation / getJavaScalarFunctionImplementation and run locally by the engine. This manager intentionally refuses remote function execution.","triggerScenarios":"Calling executeFunction(String source, FunctionHandle, Page, List<Integer> channels, TypeManager) on the Hive function namespace manager, typically from code that invokes dynamic functions through the FunctionManager execution API.","commonSituations":"Custom connectors or plugins trying to execute Hive UDFs via the generic remote-execution interface; misconfigured function resolution routing Hive functions down the executeFunction path.","solutions":["Use specializedFunctionImplementation(...) or getJavaScalarFunctionImplementation() to obtain the local implementation and invoke it directly.","Ensure the function is resolved to a HiveFunctionHandle so the engine uses the local code path, not executeFunction.","Implement a custom FunctionNamespaceManager overriding executeFunction if remote execution is genuinely required."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    return manager.executeFunction(source, handle, page, channels, typeManager);\n} catch (IllegalStateException e) {\n    // use local implementation instead\n    ScalarFunctionImplementation impl = manager.getJavaScalarFunctionImplementation(handle);\n    return invokeLocally(impl, page, channels);\n}","preventionTips":["Never route Hive functions through the generic executeFunction API.","Obtain and invoke the specialized/local function implementation.","Document in plugin code that Hive namespace is resolution-only."],"tags":["hive","function-execution","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"}