[arrow-array] rename size parameters to value_length#55
Draft
alamb wants to merge 7 commits intoalamb/fsb_overflow_try3from
Draft
[arrow-array] rename size parameters to value_length#55alamb wants to merge 7 commits intoalamb/fsb_overflow_try3from
alamb wants to merge 7 commits intoalamb/fsb_overflow_try3from
Conversation
# Which issue does this PR close? - related to https://github.com/apache/arrow-rs/pull/9850/changes#r3170266352 # Rationale for this change While working on apache#9850 I felt it would help to have some better docs about what a FixedSizeBinaryArray actually was, so I made some # What changes are included in this PR? Add some more background / explanatory docs about this array # Are these changes tested? By CI # Are there any user-facing changes? Docs only
…iles using non-standard block sizes (apache#9794) # Which issue does this PR close? - Closes apache#9793. # Rationale for this change `DeltaBitPackDecoder::skip` uses some magic numbers when sizing the buffer used for skipping. Files that use non-standard miniblock sizes will cause `skip` to panic. # What changes are included in this PR? Check for non-standard miniblock sizes and return an error rather than a panic. Note: allocating a vec sized with `values_per_mini_block` resulted in a significant performance regression. # Are these changes tested? Yes, test with file with non-standard sizes is added to the arrow_reader tests. # Are there any user-facing changes? No.
…tests for nested types (apache#9853) # Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - Closes #NNN. # Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> In apache#9600 we added capability to call `finish_preserve_values` on any array builder, and it will propagate the choice to preserve dictionary values down into the nested builders. I thought it would be good to extend the integration tests we have in https://github.com/apache/arrow-rs/blob/main/arrow-ipc/tests/test_delta_dictionary.rs to cover the use cases, which was to call the method on builders with nested child builders (such as `StructBuilder` and `ListBuilder`). While reviewing the PR for apache#9600 I also noticed a small issue with the docs related to using the StreamWriter with delta dictionaries, notably that we set up some options to use delta dictionaries but don't pass the options into the `StreamWriter` constructor: https://docs.rs/arrow-ipc/58.1.0/arrow_ipc/writer/struct.StreamWriter.html#example---efficient-delta-dictionaries # What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> - adds cases to the integration tests for delta dictionaries covering `ListBuilder` and `StructBuilder` - small docs correction for `StreamWriter` # Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> it is simply docs & tests # Are there any user-facing changes? No <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. -->
…#9872) # Which issue does this PR close? - Closes apache#9850 # Rationale for this change `FixedSizeBinaryArray::value_offset_at` works use `i32` arithmetic which can overflow. For offsets beyond `i32::MAX`, that can be bad # What changes are included in this PR? 1. Prevent any FixedSizedBinaryArrays from being constructed where the offset calculation could overflow 2. Add some other overflow checks As @adamreeve [pointed out](apache#9850 (comment)) on apache#9850 there are several places where the `i32` arithmetic is problematic in `FixedSizeBinaryArray`. I will fix them for real in a different, follow on PR, by switching to entirely `usize` based arithmetic for offset calculations However, since I hope to backport this PR to older releases, I would like something that is easy to review and has the least potential for unintended consequences. # Are these changes tested? I added unit tests. However, I can't find any way to fully trigger the actual paths short of trying to allocate very large arrays, which I don't think is appropriate for unit tests. # Are there any user-facing changes? Better limit checking
…ache#9892) # Which issue does this PR close? None # Rationale for this change Arrow and Datafusion provide this guidance, it's high time we do as well. # What changes are included in this PR? Add links to the Arrow and ASF AI policies. # Are these changes tested? Docs only # Are there any user-facing changes? Only to project documentation
In preparation for a specialized interleave kernel. # Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. --> - No issue needed: benchmark addition # Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> I want to open a subsequent PR adding the specialized REE interleave kernel. # What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Benchmarks # Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Not necessary # Are there any user-facing changes? <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. If there are any breaking changes to public APIs, please call them out. --> No Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>
12c4e78 to
cadf3d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is stacked on apache#9872.
It updates
FixedSizeBinaryArrayconstructor and local variable names fromsizetovalue_length/value_sizewhere that improves readability, without changing behavior.Why
The overflow fix in apache#9872 is easier to review when the naming-only cleanup is split out. This PR carries only the terminology changes so the lower PR can stay focused on the bounds and overflow checks.
Validation
cargo test -p arrow-array validate_lengthscargo test -p arrow-array test_constructorscargo +stable fmt --all --check