cloud-fan 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_r245678432
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DatasetAggregatorSuite.scala
##########
@@ -323,6 +323,25 @@ class DatasetAggregatorSuite extends QueryTest with
SharedSQLContext {
("a", 2.0, 2L, 4.0, 4L), ("b", 3.0, 1L, 3.0, 3L))
}
+ test("typed aggregate: min, max") {
+ val ds = Seq("a" -> 1, "a" -> 3, "b" -> 4, "b" -> -4, "b" -> 0).toDS()
+ checkDataset(
+ ds.groupByKey(_._1).agg(
+ typed.min(_._2), typed.minLong(_._2), typed.max(_._2),
typed.maxLong(_._2)),
+ ("a", Some(1.0), Some(1L), Some(3.0), Some(3L)),
+ ("b", Some(-4.0), Some(-4L), Some(4.0), Some(4L)))
+ }
+
+ test("typed aggregate: empty") {
Review comment:
can we test empty input with global aggregate in the java test as well?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]