diff options
author | Wenchen Fan <wenchen@databricks.com> | 2017-01-03 22:40:14 -0800 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2017-01-03 22:40:14 -0800 |
commit | cbd11d235752d0ab30cfdbf2351cb3e68a123606 (patch) | |
tree | 38ec8095c4f42a6e10f19c3583ec8a573a60f91e /sql/catalyst/src/test | |
parent | b67b35f76b684c5176dc683e7491fd01b43f4467 (diff) | |
download | spark-cbd11d235752d0ab30cfdbf2351cb3e68a123606.tar.gz spark-cbd11d235752d0ab30cfdbf2351cb3e68a123606.tar.bz2 spark-cbd11d235752d0ab30cfdbf2351cb3e68a123606.zip |
[SPARK-19072][SQL] codegen of Literal should not output boxed value
## What changes were proposed in this pull request?
In https://github.com/apache/spark/pull/16402 we made a mistake that, when double/float is infinity, the `Literal` codegen will output boxed value and cause wrong result.
This PR fixes this by special handling infinity to not output boxed value.
## How was this patch tested?
new regression test
Author: Wenchen Fan <wenchen@databricks.com>
Closes #16469 from cloud-fan/literal.
Diffstat (limited to 'sql/catalyst/src/test')
-rw-r--r-- | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala index 6fc3de178f..6fe295c3dd 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/PredicateSuite.scala @@ -324,4 +324,9 @@ class PredicateSuite extends SparkFunSuite with ExpressionEvalHelper { Literal.create(struct, structType), Literal.create(unsafeStruct, structType)), true) } + + test("EqualTo double/float infinity") { + val infinity = Literal(Double.PositiveInfinity) + checkEvaluation(EqualTo(infinity, infinity), true) + } } |