diff options
author | Reynold Xin <rxin@databricks.com> | 2015-07-29 09:36:22 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-07-29 09:36:22 -0700 |
commit | 97906944e133dec13068f16520b6abbcdc79e84f (patch) | |
tree | 0b836b4fc6edfc4cfdf33e828bebc638aec73087 /sql | |
parent | 708794e8aae2c66bd291bab4f12117c33b57840c (diff) | |
download | spark-97906944e133dec13068f16520b6abbcdc79e84f.tar.gz spark-97906944e133dec13068f16520b6abbcdc79e84f.tar.bz2 spark-97906944e133dec13068f16520b6abbcdc79e84f.zip |
[SPARK-9127][SQL] Rand/Randn codegen fails with long seed.
Author: Reynold Xin <rxin@databricks.com>
Closes #7747 from rxin/SPARK-9127 and squashes the following commits:
e851418 [Reynold Xin] [SPARK-9127][SQL] Rand/Randn codegen fails with long seed.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala index 698c81ba24..5db9926548 100644 --- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala +++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/RandomSuite.scala @@ -20,8 +20,6 @@ package org.apache.spark.sql.catalyst.expressions import org.scalatest.Matchers._ import org.apache.spark.SparkFunSuite -import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.types.DoubleType class RandomSuite extends SparkFunSuite with ExpressionEvalHelper { @@ -30,4 +28,9 @@ class RandomSuite extends SparkFunSuite with ExpressionEvalHelper { checkDoubleEvaluation(Rand(30), 0.7363714192755834 +- 0.001) checkDoubleEvaluation(Randn(30), 0.5181478766595276 +- 0.001) } + + test("SPARK-9127 codegen with long seed") { + checkDoubleEvaluation(Rand(5419823303878592871L), 0.4061913198963727 +- 0.001) + checkDoubleEvaluation(Randn(5419823303878592871L), -0.24417152005343168 +- 0.001) + } } |