diff options
author | Wenchen Fan <cloud0fan@outlook.com> | 2015-07-27 11:02:16 -0700 |
---|---|---|
committer | Josh Rosen <joshrosen@databricks.com> | 2015-07-27 11:02:16 -0700 |
commit | e2f38167f8b5678ac45794eacb9c7bb9b951af82 (patch) | |
tree | 68cb8b964767e8205364972080a8cc8299841f92 /sql | |
parent | c0b7df68f81c2a2a9c1065009fe75c278fa30499 (diff) | |
download | spark-e2f38167f8b5678ac45794eacb9c7bb9b951af82.tar.gz spark-e2f38167f8b5678ac45794eacb9c7bb9b951af82.tar.bz2 spark-e2f38167f8b5678ac45794eacb9c7bb9b951af82.zip |
[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 <cloud0fan@outlook.com>
Closes #7691 from cloud-fan/seed and squashes the following commits:
eae7281 [Wenchen Fan] use a seed in RandomDataGeneratorSuite
Diffstat (limited to 'sql')
-rw-r--r-- | sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGeneratorSuite.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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 677ba0a180..cccac7efa0 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) { |