prestodb/presto · error · IllegalArgumentException

Unsupported frame start type:

Error message

Unsupported frame start type: 

What it means

When computing a RANGE frame's start boundary, getFrameRange switches on the frame start type (UNBOUNDED_PRECEDING, PRECEDING, CURRENT_ROW, FOLLOWING). The default branch throws because UNBOUNDED_FOLLOWING is illegal as a frame start; reaching it means an invalid FrameInfo slipped through analysis.

Source

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

        // 2. non-null value in current row. Find frame boundaries starting from recentRange
        int frameStart;
        switch (frameInfo.getStartType()) {
            case UNBOUNDED_PRECEDING:
                frameStart = 0;
                break;
            case CURRENT_ROW:
                frameStart = peerGroupStart - partitionStart;
                break;
            case PRECEDING:
                frameStart = getFrameStartPreceding(recentRange.getStart(), frameInfo, startComparator);
                break;
            case FOLLOWING:
                // note: this is the only case where frameStart might get out of partition bound
                frameStart = getFrameStartFollowing(recentRange.getStart(), frameInfo, startComparator);
                break;
            default:
                // start type cannot be UNBOUNDED_FOLLOWING
                throw new IllegalArgumentException("Unsupported frame start type: " + frameInfo.getStartType());
        }

        int frameEnd;
        switch (frameInfo.getEndType()) {
            case UNBOUNDED_FOLLOWING:
                frameEnd = partitionEnd - partitionStart - 1;
                break;
            case CURRENT_ROW:
                frameEnd = peerGroupEnd - partitionStart - 1;
                break;
            case PRECEDING:
                // note: this is the only case where frameEnd might get out of partition bound
                frameEnd = getFrameEndPreceding(recentRange.getEnd(), frameInfo, endComparator);
                break;
            case FOLLOWING:
                frameEnd = getFrameEndFollowing(recentRange.getEnd(), frameInfo, endComparator);
                break;
            default:

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Use only valid frame starts in OVER clauses: UNBOUNDED PRECEDING, <n> PRECEDING, CURRENT ROW, or <n> FOLLOWING.
  2. If constructing FrameInfo in custom code, validate startType != UNBOUNDED_FOLLOWING before execution.
  3. Report as a planner bug if reproducible from ordinary SQL.
Defensive patterns

Strategy: validation

Validate before calling

-- valid frame starts only: UNBOUNDED PRECEDING, <n> PRECEDING, CURRENT ROW, <n> FOLLOWING
SELECT sum(x) OVER (ORDER BY t ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM tab;

Prevention

When it happens

Trigger: A FrameInfo with startType UNBOUNDED_FOLLOWING or an unknown start type reaching the window operator — normally prevented by SQL grammar; possible only via internal bugs or custom FrameInfo construction.

Common situations: Presto internal inconsistencies between frame analysis and execution; custom plugins building FrameInfo manually.

Related errors


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