Skip to content

issue fix 26388 - #26427

Closed
rizzabhdwaj wants to merge 1 commit into
apache:mainfrom
rizzabhdwaj:issue_26388_pr
Closed

rizzabhdwaj wants to merge 1 commit into
apache:mainfrom
rizzabhdwaj:issue_26388_pr

Conversation

@rizzabhdwaj

Copy link
Copy Markdown

Which issue does this PR close?

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.

@github-actions github-actions Bot added the functions Changes to functions implementation label Oct 16, 2026
@neilconway

Copy link
Copy Markdown
Contributor

@rishabh1244 When an issue is assigned to someone, can you please ask if you can work on it before you send a PR? Please read the contributor guidelines for this recommendation as well as other suggestions for how to contribute to DataFusion.

@rizzabhdwaj

Copy link
Copy Markdown
Author

@rishabh1244 When an issue is assigned to someone, can you please ask if you can work on it before you send a PR? Please read the contributor guidelines for this recommendation as well as other suggestions for how to contribute to DataFusion.

aight ,mb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

translate panics when output would exceed 2GB

2 participants