Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add offsets accessors to variable length arrays (#3879) #4048

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Part of #3879

Rationale for this change

This provides access to the typed buffer abstractions, which allows for destructing of arrays. I opted to add new functions, instead of changing the return types of value_data and value_offsets to reduce code churn, and also because the value prefix is a tad redundant. I expect we may eventually deprecate and remove the old methods.

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Apr 11, 2023
@@ -67,6 +67,18 @@ impl<T: ByteArrayType> GenericByteArray<T> {
offsets[i + 1] - offsets[i]
}

/// Returns a reference to the offsets of this array
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it might help to note in the docstrings:

  1. How this is different than value_offsets (other than the signature)
  2. Which is preferred (it sounds from this PR's description that offsets is preferred, but that is not obvious from the code as it is written)

The same applies to values and value_data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants