Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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