irenjj commented on code in PR #15001:
URL: https://github.com/apache/datafusion/pull/15001#discussion_r1979377790


##########
datafusion/sqllogictest/test_files/explain_tree.slt:
##########
@@ -185,6 +188,32 @@ physical_plan
 26)│       DataSourceExec      ││       DataSourceExec      │
 27)└───────────────────────────┘└───────────────────────────┘
 
+# Long Filter (demonstrate what happens with wrapping)
+query TT
+explain SELECT int_col FROM table1
+WHERE string_col != 'foo' AND string_col != 'bar' AND string_col != 'a really 
long string constant'
+;
+----
+logical_plan
+01)Projection: table1.int_col
+02)--Filter: table1.string_col != Utf8("foo") AND table1.string_col != 
Utf8("bar") AND table1.string_col != Utf8("a really long string constant")
+03)----TableScan: table1 projection=[int_col, string_col], 
partial_filters=[table1.string_col != Utf8("foo"), table1.string_col != 
Utf8("bar"), table1.string_col != Utf8("a really long string constant")]
+physical_plan
+01)┌───────────────────────────┐
+02)│    CoalesceBatchesExec    │
+03)└─────────────┬─────────────┘
+04)┌─────────────┴─────────────┐
+05)│         FilterExec        │
+06)│    --------------------   │
+07)│         predicate:        │
+08)│string_col@1 != foo AND ...│

Review Comment:
   This is a very nice case for `// TODO: check every line is less than 
MAX_LINE_RENDER_SIZE`. In DuckDB, we can get the following result:
   ```
   D explain select * from t1 where c != 'foo' and c != 'bar' and c != 'a 
really long string constant';
   
   ┌─────────────────────────────┐
   │┌───────────────────────────┐│
   ││       Physical Plan       ││
   │└───────────────────────────┘│
   └─────────────────────────────┘
   ┌───────────────────────────┐
   │         SEQ_SCAN          │
   │    ────────────────────   │
   │         Table: t1         │
   │   Type: Sequential Scan   │
   │       Projections: c      │
   │                           │
   │          Filters:         │
   │ c!='foo' AND c!='bar' AND │
   │  c!='a really long string │
   │          constant'        │
   │                           │
   │          ~1 Rows          │
   └───────────────────────────┘
   ```



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to