alamb commented on code in PR #15031:
URL: https://github.com/apache/datafusion/pull/15031#discussion_r1984109816
##########
datafusion/physical-plan/src/display.rs:
##########
@@ -945,6 +946,54 @@ impl TreeRenderVisitor<'_, '_> {
false
}
+
+ fn split_string_buffer(source: &str, result: &mut Vec<String>) {
+ let mut character_pos = 0;
+ let mut start_pos = 0;
+ let mut render_width = 0;
+ let mut last_possible_split = 0;
+
+ // Get grapheme clusters iterator
+ let graphemes: Vec<&str> = source.graphemes(true).collect();
Review Comment:
I think we could do this with source.chars() and get almost the same
results, except for very rare cases where multiply unicode characters make up a
single graphical grapheme
##########
datafusion/sqllogictest/test_files/explain_tree.slt:
##########
@@ -206,14 +206,18 @@ physical_plan
05)│ FilterExec │
06)│ -------------------- │
07)│ predicate: │
-08)│string_col@1 != foo AND ...│
-09)└─────────────┬─────────────┘
-10)┌─────────────┴─────────────┐
-11)│ RepartitionExec │
-12)└─────────────┬─────────────┘
-13)┌─────────────┴─────────────┐
-14)│ DataSourceExec │
-15)└───────────────────────────┘
+08)│ string_col@1 != foo AND │
Review Comment:
Can you also add a test for
1. an even longer expression? One that would take 100 lines or something? I
think there should also be a maximum length limit
2. a predicate with exactly the render width
3. A predicate with the render width + 1
--
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]