-
Notifications
You must be signed in to change notification settings - Fork 221
Add extend
/extend_unchecked
for MutableUtf8Array
#413
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jorgecarleitao I started working on MutableUtf8Array
, it passes a simple test case.
Will you be able to look at the code, and suggest changes, just to make sure I am on the correct track.
Thanks for picking this up! This is a great start! Two notes: if we use a vector, we will need to double-allocate: one for the vector, one for the An idea: create a new function (not method) fn unsafe trusted_len_values_iter(iterator) {
/// initialize the state
let capacity = iterator.size_hint().1.unwrap();
let mut offsets = MutableBuffer::with_capacity(capacity + 1);
offsets.push(O::default());
let mut values = MutableBuffer::new();
extend_from_trusted_len_iter_values(&mut offsets, &mut values, iterator);
(offsets, values)
} then, move the The same ideas can be applied to the one with the validity. |
2d61d67
to
0bb1e56
Compare
@jorgecarleitao Now,
If you can review once more, and provide feedback, I will feel more confident working on the others independently, and hopefully disturb you less often. PS: All of the existing tests and new tests passed locally, I will spend more time cleaning up new tests written for this PR. |
Codecov Report
@@ Coverage Diff @@
## main #413 +/- ##
==========================================
- Coverage 80.96% 80.88% -0.09%
==========================================
Files 347 353 +6
Lines 22141 22554 +413
==========================================
+ Hits 17927 18242 +315
- Misses 4214 4312 +98
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, looks great! 💯
Let two minor comments.
Feel free to move this to non-draft, change the title to be only for the MutableUtf8Array
and we can merge this one.
extend
/extend_unchecked
on builder/mutablearraysextend
/extend_unchecked
for MutableUtf8Array
This PR adds
TrustedLen
-basedextend
andextend_unchecked
methods forMutableUtf8Array
.