Github user henryr commented on a diff in the pull request:
https://github.com/apache/spark/pull/21482#discussion_r192520713
--- Diff:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/NullExpressionsSuite.scala
---
@@ -56,6 +56,16 @@ class NullExpressionsSuite extends SparkFunSuite with
ExpressionEvalHelper {
assert(ex.contains("Null value appeared in non-nullable field"))
}
+ test("IsInf") {
+ checkEvaluation(IsInf(Literal(Double.PositiveInfinity)), true)
+ checkEvaluation(IsInf(Literal(Double.NegativeInfinity)), true)
+ checkEvaluation(IsInf(Literal(Float.PositiveInfinity)), true)
+ checkEvaluation(IsInf(Literal(Float.NegativeInfinity)), true)
+ checkEvaluation(IsInf(Literal.create(null, DoubleType)), false)
+ checkEvaluation(IsInf(Literal(Float.MaxValue)), false)
+ checkEvaluation(IsInf(Literal(5.5f)), false)
--- End diff --
check NaN as well?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]