{"record":{"id":"a09432fc30b63d90","repo":"prestodb/presto","slug":"invalid-function-name","errorCode":"INVALID_FUNCTION_NAME","errorMessage":"Temporary functions cannot be qualified.","messagePattern":"Temporary functions cannot be qualified\\.","errorType":"error_code","errorClass":"SemanticException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java","lineNumber":4276,"sourceCode":"                    SingleColumn column = (SingleColumn) item;\n                    Optional<Identifier> alias = column.getAlias();\n                    if (alias.isPresent()) {\n                        assignments.put(QualifiedName.of(alias.get().getValue()), column.getExpression()); // TODO: need to know if alias was quoted\n                    }\n                    else if (column.getExpression() instanceof Identifier) {\n                        assignments.put(QualifiedName.of(((Identifier) column.getExpression()).getValue()), column.getExpression());\n                    }\n                }\n            }\n\n            return assignments.build();\n        }\n\n        private void checkFunctionName(Statement node, QualifiedName functionName, boolean isTemporary)\n        {\n            if (isTemporary) {\n                if (functionName.getParts().size() != 1) {\n                    throw new SemanticException(INVALID_FUNCTION_NAME, node, \"Temporary functions cannot be qualified.\");\n                }\n\n                List<String> builtInFunctionNames = functionAndTypeResolver.listBuiltInFunctions().stream()\n                        .map(SqlFunction::getSignature)\n                        .map(Signature::getName)\n                        .map(QualifiedObjectName::getObjectName)\n                        .collect(toImmutableList());\n                if (builtInFunctionNames.contains(functionName.toString())) {\n                    throw new SemanticException(INVALID_FUNCTION_NAME, node, format(\"Function %s is already registered as a built-in function.\", functionName));\n                }\n            }\n            else {\n                if (functionName.getParts().size() != 3) {\n                    throw new SemanticException(INVALID_FUNCTION_NAME, node, format(\"Function name should be in the form of catalog.schema.function_name, found: %s\", functionName));\n                }\n            }\n        }\n","sourceCodeStart":4258,"sourceCodeEnd":4294,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java#L4258-L4294","documentation":"Analysis error: a temporary (session) function was referenced with a qualified name such as catalog.func or schema.func. Temporary functions live only in the session namespace and must be invoked unqualified; qualifying one is rejected because no catalog can resolve it.","triggerScenarios":"Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java:4276 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call the temporary function without any qualifier, e.g. my_func(x)","Create a permanent function in a catalog if qualified access is needed","Rename conflicting permanent functions and drop the temporary one"],"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"}