You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Rich-T-kid (via GitHub)" <gi...@apache.org> on 2026/07/26 22:48:46 UTC

[PR] chore: add unchecked array builder methods [arrow-rs]

Rich-T-kid opened a new pull request, #10440:
URL: https://github.com/apache/arrow-rs/pull/10440

   # 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 #10244.
   
   # Rationale for this change
   we can avoid un-needed validation at callsites by using `new_unchecked()` instead of `new()`.
   <!--
   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.
   -->
   
   # What changes are included in this PR?
    added missing `new_unchecked` methods for PrimitiveArray, BooleanArray, GenericListArray, FixedSizeListArray, FixedSizeBinaryArray and MapArray.
   <!--
   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.
   -->
   
   # Are these changes tested?
   n/a no call sites have been changes yet.
   <!--
   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)?
   
   If this PR claims a performance improvement, please include evidence such as benchmark results.
   -->
   
   # Are there any user-facing changes?
   users now have the option to construct these arrays without validation but it must be done within an unsafe block.
   <!--
   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.
   -->
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add unchecked array builder methods [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10440:
URL: https://github.com/apache/arrow-rs/pull/10440#issuecomment-5107511303

   Thanks again @Jefffrey and @Rich-T-kid 


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add unchecked array builder methods [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #10440:
URL: https://github.com/apache/arrow-rs/pull/10440#issuecomment-5085770862

   A follow up PR will wire up call sites that don't ned the validation that `new()` provides for `new_unchecked()`. decided not to include it here to make it easier to review


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add unchecked array builder methods [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb commented on PR #10440:
URL: https://github.com/apache/arrow-rs/pull/10440#issuecomment-5093579845

   > especially for primitive & boolean arrays, maybe having less of a surface area is actually better since we're just skipping a single len check (well option + len check)
   > 
   > thoughts?
   
   I think personally it would be better to have consistent APIs though the different array types (even if the difference between `try` and `try_new` is minimal for some types). Mostly I think it is better because then the API is more consistent and we don't have to remember why we need to use `unsafe` for StringView but just `new` for BooleanArray, as an example


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add unchecked array builder methods [arrow-rs]

Posted by "Rich-T-kid (via GitHub)" <gi...@apache.org>.
Rich-T-kid commented on PR #10440:
URL: https://github.com/apache/arrow-rs/pull/10440#issuecomment-5086083833

   > looking at these now, i wonder if we omitted having these because it only really skips some constant checks (i.e. we're not validating per element, we just have some cheap len checks) 🤔
   > 
   > especially for primitive & boolean arrays, maybe having less of a surface area is actually better since we're just skipping a single len check (well option + len check)
   > 
   > thoughts?
   
   @Jefffrey yea I generally agree with having less of an api surface, especially in this case where we would force callers to have unsafe blocks for minimal value.
   
   i'm not entirely opposed to the idea of keeping these methods to fit in with all of the other array `new_unchecked()` methods.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: add unchecked array builder methods [arrow-rs]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb merged PR #10440:
URL: https://github.com/apache/arrow-rs/pull/10440


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org