chore: add unchecked array builder methods - #10440
Conversation
|
A follow up PR will wire up call sites that don't ned the validation that |
abff86a to
51abc62
Compare
Jefffrey
left a comment
There was a problem hiding this comment.
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 |
I think personally it would be better to have consistent APIs though the different array types (even if the difference between |
alamb
left a comment
There was a problem hiding this comment.
Looks good to me -- thank you @Rich-T-kid and @Jefffrey
Which issue does this PR close?
new_uncheckedconstruction methods for all array types #10244.Rationale for this change
we can avoid un-needed validation at callsites by using
new_unchecked()instead ofnew().What changes are included in this PR?
added missing
new_uncheckedmethods for PrimitiveArray, BooleanArray, GenericListArray, FixedSizeListArray, FixedSizeBinaryArray and MapArray.Are these changes tested?
n/a no call sites have been changes yet.
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.