This is an automated email from the ASF dual-hosted git repository.
maplefu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 63e683cbf1 GH-44677: [C++][Acero] Enhance partition sort example
(#44678)
63e683cbf1 is described below
commit 63e683cbf1a54dc43e0d45c888efb6e084837ef7
Author: Francis <[email protected]>
AuthorDate: Mon Nov 11 00:50:12 2024 +0800
GH-44677: [C++][Acero] Enhance partition sort example (#44678)
### Rationale for this change
partition sort example:
out_arr value is row id not actual value.
### What changes are included in this PR?
- partition_util.h
### Are these changes tested?
no
### Are there any user-facing changes?
comment change
* GitHub Issue: #44677
Authored-by: light-city <[email protected]>
Signed-off-by: mwish <[email protected]>
---
cpp/src/arrow/acero/partition_util.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/cpp/src/arrow/acero/partition_util.h
b/cpp/src/arrow/acero/partition_util.h
index 1413a8326a..42b21565fb 100644
--- a/cpp/src/arrow/acero/partition_util.h
+++ b/cpp/src/arrow/acero/partition_util.h
@@ -54,10 +54,11 @@ class PartitionSort {
/// in_arr: [5, 7, 2, 3, 5, 4]
/// num_prtns: 3
/// prtn_id_impl: [&in_arr] (int row_id) { return in_arr[row_id] / 3; }
- /// output_pos_impl: [&out_arr] (int row_id, int pos) { out_arr[pos] =
row_id; }
+ /// output_pos_impl: [&sorted_row_ids] (int row_id, int pos) {
sorted_row_ids[pos] =
+ /// row_id; }
///
/// After Execution
- /// out_arr: [2, 5, 3, 5, 4, 7]
+ /// sorted_row_ids: [2, 0, 3, 4, 5, 1]
/// prtn_ranges: [0, 1, 5, 6]
template <class INPUT_PRTN_ID_FN, class OUTPUT_POS_FN>
static void Eval(int64_t num_rows, int num_prtns, uint16_t* prtn_ranges,