prestodb/presto · error · IllegalArgumentException

Unsupported frame type:

Error message

Unsupported frame type: 

What it means

WindowPartition computes frame extents per window function based on the FrameInfo type (RANGE, ROWS, GROUPS). The switch only handles known frame types; an unrecognized FrameInfo.Type reaching getFrameRange throws IllegalArgumentException. This should be unreachable in normal SQL because the parser/analyzer validates frame types.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/operator/window/WindowPartition.java:276

                if (emptyFrame(range)) {
                    recentRanges.put(functionIndex, nearestValidFrame(range));
                    return new Range(-1, -1);
                }
                recentRanges.put(functionIndex, range);
                return range;
            case ROWS:
                return getFrameRange(frameInfo);
            case GROUPS:
                GroupsFrame frame = getFrameRange(frameInfo, recentGroupsFrames.get(functionIndex));
                // handle empty frame. If the frame is out of partition bounds, record the nearest valid frame as the 'recentFrame' for the next row.
                if (emptyFrame(frame.getRange())) {
                    recentGroupsFrames.put(functionIndex, nearestValidFrame(frame));
                    return new Range(-1, -1);
                }
                recentGroupsFrames.put(functionIndex, frame);
                return frame.getRange();
            default:
                throw new IllegalArgumentException("Unsupported frame type: " + frameInfo.getType());
        }
    }

    private Range getFrameRange(FrameInfo frameInfo)
    {
        int rowPosition = currentPosition - partitionStart;
        int endPosition = partitionEnd - partitionStart - 1;

        // handle empty frame
        if (emptyFrame(frameInfo, rowPosition, endPosition)) {
            return new Range(-1, -1);
        }

        int frameStart;
        int frameEnd;

        // frame start
        if (frameInfo.getStartType() == UNBOUNDED_PRECEDING) {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the frame specification in the OVER clause uses only ROWS, RANGE, or GROUPS.
  2. If using a custom/modified build, ensure every FrameInfo.Type enum value is handled in WindowPartition.
  3. File a bug with the query plan if reproducible on a stock build.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    result = executeWindowQuery();
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported frame type:")) {
        // internal/planner bug path — capture query + plan for bug report
        log.error("frame type failure, plan={}", plan);
    }
    throw e;
}

Prevention

When it happens

Trigger: Internal: a FrameInfo whose getType() is not RANGE/ROWS/GROUPS passed to a window operator — only possible via a buggy planner/analysis path or hand-constructed FrameInfo in custom code.

Common situations: Presto internal bugs after adding new frame types without updating WindowPartition; custom extensions constructing window operators directly.

Related errors


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