You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by jo...@apache.org on 2015/07/27 20:02:20 UTC

spark git commit: [SPARK-9376] [SQL] use a seed in RandomDataGeneratorSuite

Repository: spark
Updated Branches:
  refs/heads/master c0b7df68f -> e2f38167f


[SPARK-9376] [SQL] use a seed in RandomDataGeneratorSuite

Make this test deterministic, i.e. make sure this test can be passed no matter how many times we run it.

The origin implementation uses a random seed and gives a chance that we may break the null check assertion `assert(Iterator.fill(100)(generator()).contains(null))`.

Author: Wenchen Fan <cl...@outlook.com>

Closes #7691 from cloud-fan/seed and squashes the following commits:

eae7281 [Wenchen Fan] use a seed in RandomDataGeneratorSuite


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/e2f38167
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/e2f38167
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/e2f38167

Branch: refs/heads/master
Commit: e2f38167f8b5678ac45794eacb9c7bb9b951af82
Parents: c0b7df6
Author: Wenchen Fan <cl...@outlook.com>
Authored: Mon Jul 27 11:02:16 2015 -0700
Committer: Josh Rosen <jo...@databricks.com>
Committed: Mon Jul 27 11:02:16 2015 -0700

----------------------------------------------------------------------
 .../test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/e2f38167/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala b/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala
index 677ba0a..cccac7e 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala
@@ -32,7 +32,7 @@ class RandomDataGeneratorSuite extends SparkFunSuite {
    */
   def testRandomDataGeneration(dataType: DataType, nullable: Boolean = true): Unit = {
     val toCatalyst = CatalystTypeConverters.createToCatalystConverter(dataType)
-    val generator = RandomDataGenerator.forType(dataType, nullable).getOrElse {
+    val generator = RandomDataGenerator.forType(dataType, nullable, Some(33)).getOrElse {
       fail(s"Random data generator was not defined for $dataType")
     }
     if (nullable) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org