viirya commented on a change in pull request #28876:
URL: https://github.com/apache/spark/pull/28876#discussion_r443173523
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala
##########
@@ -1012,4 +1012,20 @@ class DataFrameAggregateSuite extends QueryTest
}
}
}
+
+ test("SPARK-32038: NormalizeFloatingNumbers should work on distinct
aggregate") {
+ withTempView("view") {
+ val POS_NAN_1 = java.lang.Float.intBitsToFloat(0x7f800001)
+ val POS_NAN_2 = java.lang.Float.intBitsToFloat(0x7fffffff)
+
+ Seq(("mithunr", Float.NaN),
+ ("mithunr", POS_NAN_1),
+ ("mithunr", POS_NAN_2),
+ ("abellina", 1.0f),
+ ("abellina", 2.0f)).toDF("uid",
"score").createOrReplaceTempView("view")
+
+ val df = spark.sql(" select uid, count(distinct score) from view group
by 1 order by 1 asc ")
Review comment:
Fixed. 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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]