MaxGekk commented on a change in pull request #27873: [SPARK-31117][SQL][TEST] 
reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#discussion_r391055185
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeUtilsSuite.scala
 ##########
 @@ -623,10 +623,12 @@ class DateTimeUtilsSuite extends SparkFunSuite with 
Matchers with SQLHelper {
       "MIT" -> Set(15338))
     for (tz <- ALL_TIMEZONES) {
       val skipped = skipped_days.getOrElse(tz.getID, Set.empty)
-      (-20000 to 20000).foreach { d =>
+      val testingData = Seq(-20000, 20000) ++
+        (1 to 1000).map(_ => (math.random() * 40000 - 20000).toInt)
 
 Review comment:
   There are 2 approaches for generating random values for Catalyst's types:
   1. 
https://github.com/apache/spark/blob/1febd373ea806326d269a60048ee52543a76c918/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/LiteralGenerator.scala#L114-L124
   2. RandomDataGenerator.forType(): 
https://github.com/apache/spark/blob/9562b26914f9a0c513e34b9b90cdec60067ef055/sql/catalyst/src/test/scala/org/apache/spark/sql/RandomDataGenerator.scala#L178-L193
   
   Can you use one of them?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to