-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ARROW-9489: [C++] Add fill_null kernel implementation for (array[string], scalar[string]) #8628
Conversation
KERNEL_RETURN_IF_ERROR( | ||
ctx, builder.ReserveData(input.buffers[2]->size() + | ||
fill_value.length() * input.GetNullCount())); | ||
KERNEL_RETURN_IF_ERROR(ctx, builder.Resize(input.length + 1)); |
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.
I accidentally forgot the +1 here, and everything worked. Does CI include valgrind, and should it pick this up?
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.
The +1 should not be necessary. This is the number of values appended, not the number of offsets.
Looking at the implementation of |
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.
Just a couple comments. Thank you for this PR!
// null count 0 unless we explicitly propagate it below. | ||
DCHECK(output->buffers[0] == nullptr); | ||
|
||
if (input.MayHaveNulls() && fill_value_scalar.is_valid) { |
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.
Instead of calling MayHaveNulls
, just compute the null count and check it here.
@pitrou i think this is ready to go/review. |
…ng], scalar[string])
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.
+1, will merge. Thank you @maartenbreddels !
…ng], scalar[string]) Closes apache#8628 from maartenbreddels/ARROW-9489 Lead-authored-by: Maarten A. Breddels <maartenbreddels@gmail.com> Co-authored-by: Antoine Pitrou <antoine@python.org> Signed-off-by: Antoine Pitrou <antoine@python.org>
No description provided.