Skip to content

FilterExec TreeRender format missing fetch display #21229

Description

@zhuqi-lucas

Description

When FilterExec has a fetch value (from limit pushdown), the TreeRender display format does not include it in the output, while Default/Verbose formats correctly show fetch=N.

This means EXPLAIN FORMAT TREE output is incomplete — the limit information is silently dropped from the FilterExec node.

Steps to Reproduce

CREATE TABLE t1 (a INT) AS VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

-- Default format shows fetch:
EXPLAIN SELECT a FROM t1 WHERE a > 3 LIMIT 5;
-- FilterExec: a@0 > 3, fetch=5   ✅

-- Tree format does NOT show fetch:
EXPLAIN FORMAT TREE SELECT a FROM t1 WHERE a > 3 LIMIT 5;
-- predicate: a > 3               ❌ (missing fetch=5)

Root Cause

In FilterExec::fmt_as, the TreeRender branch only outputs the predicate:

DisplayFormatType::TreeRender => {
    write!(f, "predicate={}", fmt_sql(self.predicate.as_ref()))
}

While Default/Verbose correctly includes fetch:

write!(f, "FilterExec: {}{}{}", self.predicate, display_projections, fetch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions