rishabh1244 opened a new pull request, #26427:
URL: https://github.com/apache/datafusion/pull/26427

   ## Which issue does this PR close?
   
   - Closes #26388
   
   ## Rationale for this change
   
   String operations that produce output exceeding the supported byte-offset 
limits can currently panic with a `byte array offset overflow` error instead of 
returning a recoverable error.
   
   This PR makes string builder operations fallible so that overflow conditions 
are reported as `DataFusionError`, preventing panics during query execution.
   
   ## What changes are included in this PR?
   
   - Added fallible `try_append_value`, `try_append_placeholder`, 
`try_append_with`, and `try_append_byte_map` methods to the 
`BulkNullStringArrayBuilder` trait and both implementations.
   - Added fallible variants to `StringViewArrayBuilder`, including 
`try_append_with` and `try_append_byte_map`, with rollback semantics to 
preserve builder state on failure.
   - Introduced an error-carrying writer to propagate errors during string 
construction.
   - Migrated production call sites to the fallible APIs and propagated errors 
across `unicode/translate`, `unicode/reverse`, `core/overlay`, `string/repeat`, 
`string/split_part`, `string/chr`, `string/uuid`, and the UTF8View path in 
`unicode/initcap`.
   - Retained the existing panicking methods for backward compatibility.
   
   Successful string operations retain their existing behavior, while overflow 
conditions now return errors instead of panicking.
   
   ## What is the testing strategy for this PR?
   
   - Ran `cargo test -p datafusion-functions --lib`: all 396 tests passed.
   - Verified that the library compiles with Clippy; only dead-code warnings 
remain for unused panicking wrappers.
   
   ## Are there any user-facing changes?
   
   String operations that exceed the supported byte-offset limits now return a 
`DataFusionError` instead of panicking. Successful operations are unaffected.


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