Skip to content

Commit

Permalink
Remove incorrect assertions in scala tests
Browse files Browse the repository at this point in the history
We ran unit tests of spark on aarch64 server,
then found the values of floatToRawIntBits(0.0f / 0.0f)
and floatToRawIntBits(Float.NaN) on aarch64 are same,
after discuss with jdk-dev and scala community, we believe
the value should depend on the architecture.

This removes the incorrect assertions to make sure
the tests fit all architectures.
  • Loading branch information
huangtianhua committed Jul 19, 2019
1 parent 0512af1 commit cd5cf0c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,13 +725,6 @@ class DataFrameAggregateSuite extends QueryTest with SharedSQLContext {
}

test("SPARK-26021: NaN and -0.0 in grouping expressions") {
import java.lang.Float.floatToRawIntBits
import java.lang.Double.doubleToRawLongBits

// 0.0/0.0 and NaN are different values.
assert(floatToRawIntBits(0.0f/0.0f) != floatToRawIntBits(Float.NaN))
assert(doubleToRawLongBits(0.0/0.0) != doubleToRawLongBits(Double.NaN))

checkAnswer(
Seq(0.0f, -0.0f, 0.0f/0.0f, Float.NaN).toDF("f").groupBy("f").count(),
Row(0.0f, 2) :: Row(Float.NaN, 2) :: Nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,13 +697,6 @@ class DataFrameWindowFunctionsSuite extends QueryTest with SharedSQLContext {
}

test("NaN and -0.0 in window partition keys") {
import java.lang.Float.floatToRawIntBits
import java.lang.Double.doubleToRawLongBits

// 0.0/0.0 and NaN are different values.
assert(floatToRawIntBits(0.0f/0.0f) != floatToRawIntBits(Float.NaN))
assert(doubleToRawLongBits(0.0/0.0) != doubleToRawLongBits(Double.NaN))

val df = Seq(
(Float.NaN, Double.NaN),
(0.0f/0.0f, 0.0/0.0),
Expand Down

0 comments on commit cd5cf0c

Please sign in to comment.