{"record":{"id":"864748f6cefbf92b","repo":"prestodb/presto","slug":"not-supported-864748","errorCode":"NOT_SUPPORTED","errorMessage":"Add Function is yet to be added","messagePattern":"Add Function is yet to be added","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestBasedFunctionApis.java","lineNumber":88,"sourceCode":"\n    public UdfFunctionSignatureMap getAllFunctions()\n    {\n        return getFunctionsAt(ALL_FUNCTIONS_ENDPOINT);\n    }\n\n    public UdfFunctionSignatureMap getFunctions(String schema)\n    {\n        return getFunctionsAt(ALL_FUNCTIONS_ENDPOINT + \"/\" + schema);\n    }\n\n    public UdfFunctionSignatureMap getFunctions(String schema, String functionName)\n    {\n        return getFunctionsAt(ALL_FUNCTIONS_ENDPOINT + \"/\" + schema + \"/\" + functionName);\n    }\n\n    public String addFunction(String schema, String functionName, JsonBasedUdfFunctionMetadata metadata)\n    {\n        throw new PrestoException(NOT_SUPPORTED, \"Add Function is yet to be added\");\n    }\n\n    private UdfFunctionSignatureMap getFunctionsAt(String endpoint)\n            throws IllegalStateException\n    {\n        try {\n            URI uri = uriBuilderFrom(URI.create(restUrl))\n                    .appendPath(endpoint)\n                    .build();\n            Request request = Request.builder()\n                    .prepareGet()\n                    .setUri(uri)\n                    .build();\n\n            Map<String, List<JsonBasedUdfFunctionMetadata>> nativeFunctionSignatureMap = httpClient.execute(request, createJsonResponseHandler(functionSignatureMapJsonCodec));\n            return new UdfFunctionSignatureMap(ImmutableMap.copyOf(nativeFunctionSignatureMap));\n        }\n        catch (Exception e) {","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-function-namespace-managers/src/main/java/com/facebook/presto/functionNamespace/rest/RestBasedFunctionApis.java#L70-L106","documentation":"RestBasedFunctionApis.addFunction is an intentionally unimplemented stub of the REST function-namespace client. It immediately throws NOT_SUPPORTED because the REST backend currently only exposes function reads (fetch), not writes. Any code path attempting to create a function through the REST manager hits this.","triggerScenarios":"Calling createFunction on a catalog configured with RestBasedFunctionNamespaceManager (whose restApis delegate to RestBasedFunctionApis.addFunction).","commonSituations":"Teams switching a catalog from MySqlFunctionNamespaceManager to the REST-based one and re-running the same CREATE FUNCTION scripts; automated pipelines that provision UDFs expecting write support.","solutions":["Create/manage the functions on the REST server side directly, not through Presto SQL DDL","Keep UDF DDL on a writable manager (e.g. MySQL) and use the REST catalog only for read-only consumption","Add the REST write endpoint and implement addFunction if you own the REST function server"],"exampleFix":"// before\n-- run against REST-backed catalog\ncREATE FUNCTION catalog.schema.fn(int) RETURNS int ...\n// after\n-- register fn via the REST server's own provisioning API/tooling instead","handlingStrategy":"try-catch","validationCode":"// Detect unsupported REST manager before attempting DDL\nif (manager instanceof RestBasedFunctionNamespaceManager) {\n    throw new UnsupportedOperationException(\"Function creation not supported; provision via REST server\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    manager.createFunction(function, false);\n} catch (PrestoException e) {\n    if (e.getErrorCode().getCode() == NOT_SUPPORTED.toErrorCode().getCode()) {\n        // fall back to REST-server-side provisioning\n    } else throw e;\n}","preventionTips":["Treat REST-backed function catalogs as read-only in deployment scripts","Document which catalogs support UDF DDL and route writes accordingly","Check manager type/config at pipeline start rather than failing mid-deploy"],"tags":["not-supported","rest","function-namespace","unimplemented"],"backgroundTag":"operation-not-supported","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"}