lidavidm commented on code in PR #34912:
URL: https://github.com/apache/arrow/pull/34912#discussion_r1177176348


##########
cpp/src/arrow/acero/hash_aggregate_test.cc:
##########
@@ -4206,6 +4206,235 @@ TEST_P(GroupBy, MinMaxWithNewGroupsInChunkedArray) {
                     /*verbose=*/true);
 }
 
+TEST_P(GroupBy, FirstLastBasicTypes) {
+  std::vector<std::shared_ptr<DataType>> types;
+  types.insert(types.end(), boolean());
+  types.insert(types.end(), NumericTypes().begin(), NumericTypes().end());
+  types.insert(types.end(), TemporalTypes().begin(), TemporalTypes().end());
+
+  const std::vector<std::string> default_table = {R"([
+    [1,    1],
+    [null, 1]
+])",
+                                                  R"([
+    [0,    2],
+    [null, 3],
+    [3,    4],
+    [5,    4],
+    [4,    null],
+    [3,    1],
+    [0,    2]
+])",
+                                                  R"([
+    [0,    2],
+    [1,    null],
+    [null, 3]
+])"};
+
+  const std::string default_expected =
+      R"([
+    [1,    1,    3,    null,   null],

Review Comment:
   As I remember, they mimic dplyr's `na.rm`:
   
   > If na.rm is FALSE an NA value in any of the arguments will cause a value 
of NA to be returned, otherwise NA values are ignored. 
   
   https://rdrr.io/r/base/Extremes.html
   
   dplyr appears to interpret `na_rm` differently for `slice` (~= first, last):
   
   > Should missing values in order_by be removed from the result? If FALSE, NA 
values are sorted to the end (like in 
[arrange()](https://dplyr.tidyverse.org/reference/arrange.html)), so they will 
only be included if there are insufficient non-missing values to reach n/prop.
   
   https://dplyr.tidyverse.org/reference/slice.html



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