{"record":{"id":"5913aaeda5677eaf","repo":"prestodb/presto","slug":"generic-user-error-5913aa","errorCode":"GENERIC_USER_ERROR","errorMessage":"Cannot create function in built-in function namespace: %s","messagePattern":"Cannot create function in built-in function namespace: (.+?)","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInTypeAndFunctionNamespaceManager.java","lineNumber":1077,"sourceCode":"    {\n        for (SqlFunction function : functions) {\n            for (SqlFunction existingFunction : this.functions.list()) {\n                checkArgument(!function.getSignature().equals(existingFunction.getSignature()), \"Function already registered: %s\", function.getSignature());\n            }\n        }\n        this.functions = new FunctionMap(this.functions, functions);\n    }\n\n    @Override\n    public void setBlockEncodingSerde(BlockEncodingSerde blockEncodingSerde)\n    {\n        // Do not need to do anything here since BlockEncodingSerde is passed in constructor\n    }\n\n    @Override\n    public void createFunction(SqlInvokedFunction function, boolean replace)\n    {\n        throw new PrestoException(GENERIC_USER_ERROR, format(\"Cannot create function in built-in function namespace: %s\", function.getSignature().getName()));\n    }\n\n    @Override\n    public void alterFunction(QualifiedObjectName functionName, Optional<List<TypeSignature>> parameterTypes, AlterRoutineCharacteristics alterRoutineCharacteristics)\n    {\n        throw new PrestoException(GENERIC_USER_ERROR, format(\"Cannot alter function in built-in function namespace: %s\", functionName));\n    }\n\n    @Override\n    public void dropFunction(QualifiedObjectName functionName, Optional<List<TypeSignature>> parameterTypes, boolean exists)\n    {\n        throw new PrestoException(GENERIC_USER_ERROR, format(\"Cannot drop function in built-in function namespace: %s\", functionName));\n    }\n\n    public String getName()\n    {\n        return ID;\n    }","sourceCodeStart":1059,"sourceCodeEnd":1095,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInTypeAndFunctionNamespaceManager.java#L1059-L1095","documentation":"Error from the built-in function namespace manager's createFunction: an attempt was made to register a user-defined function in the built-in function namespace, which is read-only and reserved for functions shipped with Presto.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInTypeAndFunctionNamespaceManager.java:1077 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the function in a regular function namespace (a catalog/schema with function support)","Use a catalog configured with a UDF-capable function namespace manager","Use built-in functions or a connector-provided function instead of registering into the built-in namespace"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}