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 2020/11/10 14:28:28 UTC

[GitHub] [arrow] pitrou opened a new pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

pitrou opened a new pull request #8623:
URL: https://github.com/apache/arrow/pull/8623


   


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

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



[GitHub] [arrow] pitrou closed pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

Posted by GitBox <gi...@apache.org>.
pitrou closed pull request #8623:
URL: https://github.com/apache/arrow/pull/8623


   


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

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



[GitHub] [arrow] github-actions[bot] commented on pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #8623:
URL: https://github.com/apache/arrow/pull/8623#issuecomment-724738968


   https://issues.apache.org/jira/browse/ARROW-10345


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

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



[GitHub] [arrow] pitrou commented on a change in pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

Posted by GitBox <gi...@apache.org>.
pitrou commented on a change in pull request #8623:
URL: https://github.com/apache/arrow/pull/8623#discussion_r520605189



##########
File path: cpp/src/arrow/compute/kernels/vector_sort.cc
##########
@@ -30,6 +32,58 @@ namespace internal {
 
 namespace {
 
+// NOTE: std::partition is usually faster than std::stable_partition.
+
+struct NonStablePartitioner {
+  template <typename Predicate>
+  uint64_t* operator()(uint64_t* indices_begin, uint64_t* indices_end, Predicate&& pred) {
+    return std::partition(indices_begin, indices_end, std::forward<Predicate>(pred));
+  }
+};
+
+struct StablePartitioner {
+  template <typename Predicate>
+  uint64_t* operator()(uint64_t* indices_begin, uint64_t* indices_end, Predicate&& pred) {
+    return std::stable_partition(indices_begin, indices_end,
+                                 std::forward<Predicate>(pred));
+  }
+};
+
+// Move Nulls to end of array. Return where Null starts.
+template <typename ArrayType, typename Partitioner>

Review comment:
       @bkietz Apparently one can't use a template function as template argument. Is that right?
   (I originally wanted to pass `std::partition` as a template function argument)




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

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



[GitHub] [arrow] pitrou commented on pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

Posted by GitBox <gi...@apache.org>.
pitrou commented on pull request #8623:
URL: https://github.com/apache/arrow/pull/8623#issuecomment-724742093


   +1, will merge if green


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

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



[GitHub] [arrow] pitrou commented on pull request #8623: ARROW-10345: [C++][Compute] Fix NaN handling in sorting and topn kernels

Posted by GitBox <gi...@apache.org>.
pitrou commented on pull request #8623:
URL: https://github.com/apache/arrow/pull/8623#issuecomment-724738741


   Note: original PR is #8524, I had to close it and open a new one because Github wouldn't pick up changes.


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

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