You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/24 08:00:05 UTC

[GitHub] [arrow] pitrou commented on a diff in pull request #13857: ARROW-9773: [C++] Implement Take kernel for ChunkedArray

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


##########
cpp/src/arrow/compute/kernels/vector_selection.cc:
##########
@@ -329,10 +480,9 @@ struct PrimitiveTakeImpl {
         if (block.popcount == block.length) {
           // Faster path: indices are not null but values may be
           for (int64_t i = 0; i < block.length; ++i) {
-            if (bit_util::GetBit(values_is_valid,
-                                 values_offset + indices_data[position])) {
+            if (values.IsValid(indices_data[position])) {
               // value is not null
-              out[position] = values_data[indices_data[position]];
+              out[position] = values.GetValue(indices_data[position]);

Review Comment:
   I'll note that in the `IsValid` -> `GetValue` sequence the chunked resolution is called twice. The compiler might be able to optimize away the second call but that's not guaranteed.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org