Skip to content

Commit

Permalink
GH-44677: [C++][Acero] Enhance partition sort example (#44678)
Browse files Browse the repository at this point in the history
### 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]>
  • Loading branch information
Light-City authored Nov 10, 2024
1 parent 03c3f8e commit 63e683c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpp/src/arrow/acero/partition_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 63e683c

Please sign in to comment.