prestodb/presto · error · PrestoException

COMPILER_ERROR

COMPILER_ERROR

Error message

Compiler failed

What it means

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.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/sql/planner/LocalExecutionPlanner.java:1713

                    return new PhysicalOperation(operatorFactory, outputMappings, context, source);
                }
                else {
                    // Remote projection
                    checkArgument(locality.equals(REMOTE), format("Expect remote projection, get %s", locality));
                    OperatorFactory operatorFactory = new RemoteProjectOperatorFactory(
                            context.getNextOperatorId(),
                            planNodeId,
                            metadata.getFunctionAndTypeManager(),
                            projections);
                    return new PhysicalOperation(operatorFactory, outputMappings, context, source);
                }
            }
            catch (PrestoException e) {
                throw e;
            }
            catch (RuntimeException e) {
                throw new PrestoException(COMPILER_ERROR, "Compiler failed", e);
            }
        }

        private RowExpression bindChannels(RowExpression expression, Map<VariableReferenceExpression, Integer> sourceLayout)
        {
            Type type = expression.getType();
            Object value = new RowExpressionInterpreter(expression, metadata.getFunctionAndTypeManager(), session.toConnectorSession(), OPTIMIZED).optimize();
            if (value instanceof RowExpression) {
                RowExpression optimized = (RowExpression) value;
                // building channel info
                expression = VariableToChannelTranslator.translate(optimized, sourceLayout);
            }
            else {
                expression = constant(value, type);
            }
            return expression;
        }

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Read the wrapped cause exception for the real failure.
  2. Simplify or rewrite the offending expression to avoid the codegen path (may force interpreted mode).
  3. Upgrade Presto or file an issue with the plan and stack trace; this is usually an engine bug.
Defensive patterns

Strategy: try-catch

Validate before calling

// No pre-call validation exists; ensure expression compiler inputs (types, function handles) are well-formed and registered

Try / catch

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; } }

Prevention

When it happens

Trigger: Planning/compiling page function or expression compiler code when the underlying compiler throws an unexpected runtime exception (codegen bugs, unsupported signatures, class-loading issues).

Common situations: Engine bugs in expression codegen, JVM/classloader problems, exotic function signatures, or resource limits in the coordinator/workers.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/0da31fa312dc95d5. Report an issue: GitHub.