rustyconover opened a new issue, #24663:
URL: https://github.com/apache/datafusion/issues/24663

   ## Describe the bug
   
   Rendering a physical plan in tree format can panic when an operator name or 
detail contains multibyte UTF-8 characters. The renderer measures text in 
characters but uses those character positions as byte offsets when slicing the 
original string. Character positions are not necessarily valid UTF-8 boundaries.
   
   A representative panic is an invalid string slice boundary inside a 
multibyte character in datafusion/physical-plan/src/display.rs.
   
   ## To Reproduce
   
   Render a tree-format physical plan whose node text is long enough to wrap or 
truncate and contains a multibyte character, such as an emoji. The wrapping 
path in TreeRenderVisitor::split_string_buffer or the truncation path in 
TreeRenderVisitor::adjust_text_for_rendering can slice the string at a 
character index interpreted as a byte index.
   
   ## Expected behavior
   
   Tree-format plan rendering should wrap and truncate UTF-8 text without 
panicking, while preserving the existing character-count-based rendering 
behavior.
   
   ## Additional context
   
   The fix can iterate over chars consistently when selecting wrapped and 
truncated text, and should include regression tests for both paths. This issue 
is intentionally scoped to preventing invalid UTF-8 slicing; display-column 
widths for wide glyphs and combining characters are a separate concern.


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