Skip to content

replace MutableBuffer callsites with fallible methods - #10641

Open
Rich-T-kid wants to merge 3 commits into
apache:mainfrom
Rich-T-kid:rich-t-kid/apply-falible-buffer-methods
Open

replace MutableBuffer callsites with fallible methods#10641
Rich-T-kid wants to merge 3 commits into
apache:mainfrom
Rich-T-kid:rich-t-kid/apply-falible-buffer-methods

Conversation

@Rich-T-kid

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

it is better to return an error and let down stream users decide how to proceed than to panic.

What changes are included in this PR?

updates all call sites in the project to use the fallible alternative to mutableBuffer methods.

Are these changes tested?

n/a behavior hasn't changed

Are there any user-facing changes?

no public methods we changed in this PR

Comment thread arrow-select/src/zip.rs
predicate: BooleanBuffer,
value: &[u8],
) -> (Buffer, OffsetBuffer<T::Offset>, Option<NullBuffer>) {
) -> Result<(Buffer, OffsetBuffer<T::Offset>, Option<NullBuffer>), ArrowError> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return type uses T::Offset which is a generic associated type, making a standalone type alias impossible;
adding a clippy suppress here

buffer.reserve(capacity);
buffer
.try_reserve(capacity)
.map_err(|e| ArrowError::MemoryError(e.to_string()))?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth having a into/from implementation so ? can handle this for us? since im seeing it a lot in this diff

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

@Rich-T-kid Rich-T-kid Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will require adding a depency link between arrow-buffer or arrow-schema to implement

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh thats a bugger 🤔

maybe better off without this then, to avoid this dependency just for this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, reverted it

@Rich-T-kid
Rich-T-kid force-pushed the rich-t-kid/apply-falible-buffer-methods branch 2 times, most recently from c90254b to b3a525d Compare August 13, 2026 03:36
@Rich-T-kid
Rich-T-kid requested a review from Jefffrey August 13, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[arrow-buffer] Add fallible APIs for overflow-prone buffer growth

2 participants