edponce commented on a change in pull request #11019:
URL: https://github.com/apache/arrow/pull/11019#discussion_r703631141



##########
File path: cpp/src/arrow/compute/api_vector.h
##########
@@ -252,6 +296,53 @@ ARROW_EXPORT
 Result<std::shared_ptr<Array>> NthToIndices(const Array& values, int64_t n,
                                             ExecContext* ctx = NULLPTR);
 
+/// \brief Returns the first k elements ordered by `options.keys`.
+///
+/// Return a sorted array with its elements rearranged in such
+/// a way that the value of the element in k-th position (options.k) is in the 
position it
+/// would be in a sorted datum ordered by `options.keys`. Null like values 
will be not
+/// part of the output. Output is not guaranteed to be stable.
+///
+/// \param[in] datum datum to be partitioned
+/// \param[in] options options
+/// \param[in] ctx the function execution context, optional
+/// \return a datum with the same schema as the input
+
+ARROW_EXPORT
+Result<std::shared_ptr<Array>> SelectK(const Datum& datum, SelectKOptions 
options,
+                                       ExecContext* ctx = NULLPTR);
+
+/// \brief Returns the first k rows ordered by `options.keys` in ascending 
order.
+///
+/// Return a sorted datum with its elements rearranged in such
+/// a way that the value of the element in k-th (options.k) position is in the 
position it
+/// would be in a sorted datum in ascending order. Null like values will be 
not part of
+/// the output. Output is not guaranteed to be stable.
+///
+/// \param[in] datum datum to be partitioned
+/// \param[in] options options
+/// \param[in] ctx the function execution context, optional
+/// \return a datum with the same schema as the input
+ARROW_EXPORT
+Result<std::shared_ptr<Array>> TopK(const Datum& datum, SelectKOptions options,
+                                    ExecContext* ctx = NULLPTR);
+
+/// \brief Returns the first k elements ordered by options.keys` in descending 
order.
+///
+/// Return a sorted array with its elements rearranged in such
+/// a way that the value of the element in k-th position (options.k) is in the 
position it
+/// would be in a sorted datum in descending order. Null like values will be 
not part of
+/// the output. Output is not guaranteed to be stable.
+///
+/// \param[in] datum datum to be partitioned
+/// \param[in] options options
+/// \param[in] ctx the function execution context, optional
+/// \return a datum with the same schema as the input
+
+ARROW_EXPORT

Review comment:
       Remove blank line.




-- 
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-unsubscr...@arrow.apache.org

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


Reply via email to