{"record":{"id":"0da31fa312dc95d5","repo":"prestodb/presto","slug":"compiler-error","errorCode":"COMPILER_ERROR","errorMessage":"Compiler failed","messagePattern":"Compiler failed","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java","lineNumber":1713,"sourceCode":"\n                    return new PhysicalOperation(operatorFactory, outputMappings, context, source);\n                }\n                else {\n                    // Remote projection\n                    checkArgument(locality.equals(REMOTE), format(\"Expect remote projection, get %s\", locality));\n                    OperatorFactory operatorFactory = new RemoteProjectOperatorFactory(\n                            context.getNextOperatorId(),\n                            planNodeId,\n                            metadata.getFunctionAndTypeManager(),\n                            projections);\n                    return new PhysicalOperation(operatorFactory, outputMappings, context, source);\n                }\n            }\n            catch (PrestoException e) {\n                throw e;\n            }\n            catch (RuntimeException e) {\n                throw new PrestoException(COMPILER_ERROR, \"Compiler failed\", e);\n            }\n        }\n\n        private RowExpression bindChannels(RowExpression expression, Map<VariableReferenceExpression, Integer> sourceLayout)\n        {\n            Type type = expression.getType();\n            Object value = new RowExpressionInterpreter(expression, metadata.getFunctionAndTypeManager(), session.toConnectorSession(), OPTIMIZED).optimize();\n            if (value instanceof RowExpression) {\n                RowExpression optimized = (RowExpression) value;\n                // building channel info\n                expression = VariableToChannelTranslator.translate(optimized, sourceLayout);\n            }\n            else {\n                expression = constant(value, type);\n            }\n            return expression;\n        }\n","sourceCodeStart":1695,"sourceCodeEnd":1731,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java#L1695-L1731","documentation":"LocalExecutionPlanner wraps any RuntimeException (other than PrestoException) raised while compiling an expression's generated code into a PrestoException with COMPILER_ERROR. It indicates the expression bytecode compiler failed for a plan operator.","triggerScenarios":"Planning/compiling page function or expression compiler code when the underlying compiler throws an unexpected runtime exception (codegen bugs, unsupported signatures, class-loading issues).","commonSituations":"Engine bugs in expression codegen, JVM/classloader problems, exotic function signatures, or resource limits in the coordinator/workers.","solutions":["Read the wrapped cause exception for the real failure.","Simplify or rewrite the offending expression to avoid the codegen path (may force interpreted mode).","Upgrade Presto or file an issue with the plan and stack trace; this is usually an engine bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// No pre-call validation exists; ensure expression compiler inputs (types, function handles) are well-formed and registered","typeGuard":null,"tryCatchPattern":"try { plan = planner.planOperator(...); } catch (PrestoException e) { if (e.getErrorCode() == StandardErrorCode.COMPILER_ERROR.toErrorCode()) { log(e.getCause()); /* fall back to interpreted expression evaluation */ } else { throw e; } }","preventionTips":["Inspect the cause chain of COMPILER_ERROR for the real failure","Keep coordinator/worker JVM and Presto versions aligned","Avoid exotic custom function signatures that stress codegen; test them in staging","File engine bugs with the full plan and stack trace"],"tags":["codegen","compiler","planner"],"backgroundTag":"codegen-compiler-failure","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"}