jayzhan211 commented on code in PR #27208:
URL: https://github.com/apache/datafusion/pull/27208#discussion_r4504890675


##########
datafusion/physical-optimizer/src/sanity_checker.rs:
##########
@@ -135,8 +135,8 @@ pub fn check_finiteness_requirements(
         && input.pipeline_behavior() == EmissionType::Final)
     {
         plan_err!(
-            "Cannot execute pipeline breaking queries, operator: {:?}",
-            input
+            "Cannot execute pipeline breaking queries, operator: {}",
+            displayable(input).one_line()

Review Comment:
   Optional cleanup: `one_line()` adds a line break at the end because it's 
built for `EXPLAIN` output, so this error message now ends with an empty line. 
Trimming it, as `statistics.rs` already does with `one_line()`, keeps the 
message on one line:
   
   ```suggestion
               displayable(input).one_line().to_string().trim_end()
   ```



##########
datafusion/sqllogictest/test_files/ddl.slt:
##########
@@ -1343,3 +1343,21 @@ create database cat;
 
 statement ok
 drop database cat;
+
+##########
+# A pipeline-breaking operator on an unbounded input should be reported with
+# its EXPLAIN-style one-line form, not the operator's Debug representation.
+##########
+
+statement ok
+CREATE UNBOUNDED EXTERNAL TABLE ordering_on_unbounded (
+  a0 INT, a INT, b INT, c INT, d INT
+) STORED AS CSV
+LOCATION '../core/tests/data/window_2.csv'
+OPTIONS ('format.has_header' 'true');
+
+statement error Error during planning: Cannot execute pipeline breaking 
queries, operator: SortExec: TopK\(fetch=1\), expr=\[d@4 ASC NULLS LAST\], 
preserve_partitioning=\[false\]
+SELECT * FROM ordering_on_unbounded ORDER BY d LIMIT 1;

Review Comment:
   Optional cleanup: the escaped regex is hard to read. `statement error` can 
take the expected message as plain text after `----`, like `functions.slt` 
does, which also checks the whole message:
   
   ```suggestion
   statement error
   SELECT * FROM ordering_on_unbounded ORDER BY d LIMIT 1;
   ----
   DataFusion error: SanityCheckPlan
   caused by
   Error during planning: Cannot execute pipeline breaking queries, operator: 
SortExec: TopK(fetch=1), expr=[d@4 ASC NULLS LAST], 
preserve_partitioning=[false]
   ```



-- 
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