wjones127 commented on code in PR #13857:
URL: https://github.com/apache/arrow/pull/13857#discussion_r948330700


##########
cpp/src/arrow/compute/kernels/vector_selection.cc:
##########
@@ -530,6 +683,54 @@ Status PrimitiveTake(KernelContext* ctx, const ExecSpan& 
batch, ExecResult* out)
   return Status::OK();
 }
 
+Status ChunkedPrimitiveTake(KernelContext* ctx, const ExecBatch& batch, Datum* 
out) {
+  const ChunkedArray& values = *batch[0].chunked_array();
+  const ChunkedArray& indices = *batch[1].chunked_array();
+
+  if (TakeState::Get(ctx).boundscheck) {
+    RETURN_NOT_OK(CheckIndexBounds(indices, values.length()));
+  }
+
+  // TODO: Is there any reason to chunk the output for primitive arrays?
+  // We probably want to keep within 32-bit sizes for interoperability with 
other
+  // implementations.

Review Comment:
   I'm kind of liking the idea of using the take indices; potentially gives the 
user control of the chunking output of take.
   
   Of course, for cases like string and binary data, we'll probably take a 
different approach and chunk based on what fits.



-- 
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