zhuqi-lucas opened a new issue, #21229:
URL: https://github.com/apache/datafusion/issues/21229

   ## 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
   
   ```sql
   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:
   ```rust
   DisplayFormatType::TreeRender => {
       write!(f, "predicate={}", fmt_sql(self.predicate.as_ref()))
   }
   ```
   
   While `Default`/`Verbose` correctly includes fetch:
   ```rust
   write!(f, "FilterExec: {}{}{}", self.predicate, display_projections, fetch)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to