kosiew commented on code in PR #23223:
URL: https://github.com/apache/datafusion/pull/23223#discussion_r3544763122


##########
datafusion/functions/src/strings.rs:
##########
@@ -969,30 +937,70 @@ pub(crate) struct StringViewWriter<'a> {
     /// `None` while the row fits inline; becomes `Some(start)` (offset of
     /// the row's first byte in `in_progress`) at first spill.
     spill_cursor: Option<usize>,
+    error: Option<DataFusionError>,

Review Comment:
   The delayed error is needed because the existing `StringWriter` API has 
infallible `write_str` / `write_char` methods, and `try_append_with` accepts a 
closure using that writer. 
   Once a write overflows, the writer has no `Result` channel to return through 
immediately, so it records the first error and `try_append_with` returns it 
after the closure finishes, rolling back `in_progress` to `old_len`.
   
   Added 
[comment](https://github.com/apache/datafusion/pull/23223/commits/cefb00011c457e13003806c8321bb1f797fb1706).



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