prestodb/presto · error · IllegalStateException
invalid evaluation state
Error message
invalid evaluation state
What it means
readWithFilter tracks per-position filter evaluation state; each position must be in one of three known states. Reaching the default branch means the internal state machine invariant was violated, so an IllegalStateException is thrown — typically a library bug rather than user error.
Source
Thrown at presto-orc/src/main/java/com/facebook/presto/orc/reader/SliceDictionarySelectiveReader.java:263
else {
switch (evaluationStatus[index]) {
case FILTER_FAILED: {
break;
}
case FILTER_PASSED: {
if (context.isOutputRequired()) {
values[outputPositionCount] = index;
}
outputPositions[outputPositionCount] = position;
outputPositionCount++;
break;
}
case FILTER_NOT_EVALUATED: {
evaluationStatus[index] = evaluateFilter(position, index, length);
break;
}
default: {
throw new IllegalStateException("invalid evaluation state");
}
}
}
}
streamPosition++;
if (filter != null) {
outputPositionCount -= filter.getPrecedingPositionsToFail();
int succeedingPositionsToFail = filter.getSucceedingPositionsToFail();
if (succeedingPositionsToFail > 0) {
int positionsToSkip = 0;
for (int j = 0; j < succeedingPositionsToFail; j++) {
i++;
int nextPosition = positions[i];
positionsToSkip += 1 + nextPosition - streamPosition;
streamPosition = nextPosition + 1;
}
skip(positionsToSkip);View on GitHub (pinned to 55bb57d202)
Solutions
- Note the exact query, file, and Presto version and file a bug with the stack trace.
- Retry after upgrading Presto to a version containing reader fixes.
- Work around by rewriting the query to avoid the specific filter shape (e.g. simplify or reorder predicates).
- As a last resort read the column without dictionary-selective path by rewriting the file with direct encoding.
Defensive patterns
Strategy: try-catch
Try / catch
try {
return reader.read();
} catch (IllegalStateException e) {
if (e.getMessage().equals("invalid evaluation state")) {
log.error("Reader internal state bug; report with stack trace", e);
}
throw e;
} Prevention
- Upgrade Presto before reporting; this is an internal invariant violation.
- Include the query plan, file, and stack trace when filing the bug.
- Simplify or reorder filter predicates as a temporary workaround.
When it happens
Trigger: Calling read() with a filter on a dictionary-encoded string column when a position's evaluationStatus value is none of FILTER_NOT_EVALUATED, and the other handled states (an internal enum/int state not produced by the reader's own logic).
Common situations: Library bug or stale/Presto version mismatch where reader internals and filter plumbing disagree; extremely rare at runtime, usually surfaced by fuzzing or a regression in a filter implementation.
Related errors
- CLICKHOUSE_PUSHDOWN_UNSUPPORTED_EXPRESSION
- Response does not contain a JSON value
- path is empty
- Invalid field position selection after nulls removed: " + se
- Map key is null at position: " + position
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/0fed427b3ed23d63.
Report an issue: GitHub.