You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/05/20 10:44:07 UTC

[GitHub] [arrow] kou commented on a diff in pull request #12963: ARROW-16234: [C++] Vector Kernel for Rank

kou commented on code in PR #12963:
URL: https://github.com/apache/arrow/pull/12963#discussion_r878008387


##########
cpp/src/arrow/compute/api_vector.h:
##########
@@ -174,6 +174,25 @@ class ARROW_EXPORT SelectKOptions : public FunctionOptions {
   std::vector<SortKey> sort_keys;
 };
 
+/// \brief Rank options
+class ARROW_EXPORT RankOptions : public FunctionOptions {
+ public:
+  enum Tiebreaker { Min, Max, First, Dense };
+
+  explicit RankOptions(SortOrder order = SortOrder::Ascending,
+                       NullPlacement null_placement = NullPlacement::AtEnd,
+                       Tiebreaker = RankOptions::First);
+  static constexpr char const kTypeName[] = "RankOptions";
+  static RankOptions Defaults() { return RankOptions(); }
+
+  /// Sorting order
+  SortOrder order;

Review Comment:
   I like `std::vector<SortKey> sort_keys` here. If we need a shortcut for `Array`, we can add `ArrayRankOptions` like `ArraySortOptions`.



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

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