You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/09 05:55:53 UTC

[GitHub] 10110346 commented on a change in pull request #23304: [SPARK-26353][SQL]Add typed aggregate functions: max&&min

10110346 commented on a change in pull request #23304: [SPARK-26353][SQL]Add typed aggregate functions: max&&min
URL: https://github.com/apache/spark/pull/23304#discussion_r246266658
 
 

 ##########
 File path: sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java
 ##########
 @@ -66,4 +66,40 @@ public void testTypedAggregationSumLong() {
         Arrays.asList(new Tuple2<>("a", 3L), new Tuple2<>("b", 3L)),
         agged.collectAsList());
   }
+
+  @Test
+  public void testTypedAggregationMinDouble() {
+    KeyValueGroupedDataset<String, Tuple2<String, Integer>> grouped = generateGroupedDataset();
+    Dataset<Tuple2<String, Double>> agged = grouped.agg(typed.min(v -> (double)v._2()));
+    Assert.assertEquals(
+            Arrays.asList(new Tuple2<>("a", 1.0), new Tuple2<>("b", 3.0)),
 
 Review comment:
   thanks, I will update

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org