zanmato1984 commented on code in PR #44394:
URL: https://github.com/apache/arrow/pull/44394#discussion_r1824849112


##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -705,5 +736,56 @@ Result<std::shared_ptr<Array>> PairwiseDiff(const Array& 
array,
                                             bool check_overflow = false,
                                             ExecContext* ctx = NULLPTR);
 
+/// \brief Return the reverse indices of the given indices.
+///
+/// For indices[i] = x, reverse_indices[x] = i. And reverse_indices[x] = null 
if x does
+/// not appear in the input indices. For indices[i] = x where x < 0 or x >= 
output_length,
+/// it is ignored. If multiple indices point to the same value, the last one 
is used.
+///
+/// For example, with indices = [null, 0, 3, 2, 4, 1, 1], the reverse indices 
is
+///   [1, 6, 3]                    if output_length = 3,
+///   [1, 6, 3, 2, 4, null, null]  if output_length = 7.

Review Comment:
   I'll take `max_index` then. I think `stop_index` gives people an impression 
that the processing "stops early" if no index in the input reaches it, which is 
against the fact that in such case tail nulls will be appended. Whereas 
`max_index` can imply such tail nulls slightly.
   
   Thank you for the elaboration.



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