spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lix...@apache.org
Subject spark git commit: [SPARK-25605][TESTS] Run cast string to timestamp tests for a subset of timezones
Date Fri, 05 Oct 2018 01:54:49 GMT
Repository: spark
Updated Branches:
  refs/heads/master f27d96b9f -> 8113b9c96


[SPARK-25605][TESTS] Run cast string to timestamp tests for a subset of timezones

## What changes were proposed in this pull request?

The test `cast string to timestamp` used to run for all time zones. So it run for more than
600 times. Running the tests for a significant subset of time zones is probably good enough
and doing this in a randomized manner enforces anyway that we are going to test all time zones
in different runs.

## How was this patch tested?

the test time reduces to 11 seconds from more than 2 minutes

Closes #22631 from mgaido91/SPARK-25605.

Authored-by: Marco Gaido <marcogaido91@gmail.com>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>


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

Branch: refs/heads/master
Commit: 8113b9c96601d8af5b1cbc453630c648a5d45550
Parents: f27d96b
Author: Marco Gaido <marcogaido91@gmail.com>
Authored: Thu Oct 4 18:54:46 2018 -0700
Committer: gatorsmile <gatorsmile@gmail.com>
Committed: Thu Oct 4 18:54:46 2018 -0700

----------------------------------------------------------------------
 .../org/apache/spark/sql/catalyst/expressions/CastSuite.scala    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/8113b9c9/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
----------------------------------------------------------------------
diff --git a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
index d9f32c0..90c0bf7 100644
--- a/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
+++ b/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
@@ -20,6 +20,8 @@ package org.apache.spark.sql.catalyst.expressions
 import java.sql.{Date, Timestamp}
 import java.util.{Calendar, Locale, TimeZone}
 
+import scala.util.Random
+
 import org.apache.spark.SparkFunSuite
 import org.apache.spark.sql.Row
 import org.apache.spark.sql.catalyst.InternalRow
@@ -110,7 +112,7 @@ class CastSuite extends SparkFunSuite with ExpressionEvalHelper {
   }
 
   test("cast string to timestamp") {
-    for (tz <- ALL_TIMEZONES) {
+    for (tz <- Random.shuffle(ALL_TIMEZONES).take(50)) {
       def checkCastStringToTimestamp(str: String, expected: Timestamp): Unit = {
         checkEvaluation(cast(Literal(str), TimestampType, Option(tz.getID)), expected)
       }


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


Mime
View raw message