Skip to content
Snippets Groups Projects
Commit 8228b063 authored by petermaxlee's avatar petermaxlee Committed by Wenchen Fan
Browse files

[SPARK-16436][SQL] checkEvaluation should support NaN

## What changes were proposed in this pull request?
This small patch modifies ExpressionEvalHelper. checkEvaluation to support comparing NaN values for floating point comparisons.

## How was this patch tested?
This is a test harness change.

Author: petermaxlee <petermaxlee@gmail.com>

Closes #14103 from petermaxlee/SPARK-16436.
parent dff73bfa
No related branches found
No related tags found
No related merge requests found
......@@ -63,6 +63,10 @@ trait ExpressionEvalHelper extends GeneratorDrivenPropertyChecks {
expected.asInstanceOf[Spread[Double]].isWithin(result)
case (result: MapData, expected: MapData) =>
result.keyArray() == expected.keyArray() && result.valueArray() == expected.valueArray()
case (result: Double, expected: Double) =>
if (expected.isNaN) result.isNaN else expected == result
case (result: Float, expected: Float) =>
if (expected.isNaN) result.isNaN else expected == result
case _ =>
result == expected
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment