pitrou commented on code in PR #36266:
URL: https://github.com/apache/arrow/pull/36266#discussion_r1399660192


##########
cpp/src/arrow/compute/kernels/scalar_cast_string.cc:
##########
@@ -338,10 +338,12 @@ BinaryToBinaryCastExec(KernelContext* ctx, const 
ExecSpan& batch, ExecResult* ou
   if (input.offset == output->offset) {
     output->buffers[0] = input.GetBuffer(0);
   } else {
-    ARROW_ASSIGN_OR_RAISE(
-        output->buffers[0],
-        arrow::internal::CopyBitmap(ctx->memory_pool(), input.buffers[0].data,
-                                    input.offset, input.length));
+    if (input.buffers[0].data != nullptr) {
+      ARROW_ASSIGN_OR_RAISE(
+          output->buffers[0],
+          arrow::internal::CopyBitmap(ctx->memory_pool(), 
input.buffers[0].data,
+                                      input.offset, input.length));
+    }

Review Comment:
   This seems to fix a bug in the C++ kernels, so, could you add a test in this 
area as well?
   There are existing tests in 
https://github.com/apache/arrow/blob/f98a13250d10dba248a2bb85989d6b80265e82d8/cpp/src/arrow/compute/kernels/scalar_cast_test.cc#L2059
 which you could expand.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to