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



##########
File path: cpp/src/arrow/compute/api_vector.h
##########
@@ -120,20 +120,29 @@ class ARROW_EXPORT SortOptions : public FunctionOptions {
   std::vector<SortKey> sort_keys;
 };
 
-// \brief Selection algorithm. Default is `NonStableSelect` which uses a Heap 
based
-// algorithm.
-enum class SelectKAlgorithm { NonStableSelect, StableSelect };
-
 /// \brief SelectK options
 class ARROW_EXPORT SelectKOptions : public FunctionOptions {
  public:
-  explicit SelectKOptions(int64_t k = -1, std::vector<SortKey> sort_keys = {},
-                          SelectKAlgorithm kind = 
SelectKAlgorithm::NonStableSelect);
+  explicit SelectKOptions(int64_t k = -1, std::vector<SortKey> sort_keys = {});
 
   constexpr static char const kTypeName[] = "SelectKOptions";
 
-  static SelectKOptions Defaults() {
-    return SelectKOptions{-1, {}, SelectKAlgorithm::NonStableSelect};
+  static SelectKOptions Defaults() { return SelectKOptions{-1, {}}; }
+
+  static SelectKOptions TopKDefault(int64_t k, std::vector<std::string> 
key_names = {}) {
+    std::vector<SortKey> keys;
+    for (const auto& name : key_names)
+      keys.emplace_back(SortKey(name, SortOrder::Descending));

Review comment:
       ok thanks




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