You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/11 07:40:38 UTC

[GitHub] [spark] cloud-fan opened a new pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

cloud-fan opened a new pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873
 
 
   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If you fix some SQL features, you can provide some references of other DBMSes.
     3. If there is design documentation, please add the link.
     4. If there is a discussion in the mailing list, please add the link.
   -->
   `DateTimeUtilsSuite.daysToMicros and microsToDays` takes 30 seconds, which is too long for a UT.
   
   This PR changes the test to check random data, to reduce testing time. Now this test takes 1 second.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   make test faster
   
   ### Does this PR introduce any user-facing change?
   <!--
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If no, write 'No'.
   -->
   no
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   N/A

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] MaxGekk commented on a change in pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597489281
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597489287
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24386/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597598720
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119655/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597488679
 
 
   **[Test build #119655 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119655/testReport)** for PR 27873 at commit [`c7819b9`](https://github.com/apache/spark/commit/c7819b9be03b9ac87ae649c7e922ca4994893560).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan commented on a change in pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
cloud-fan 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_r390789651
 
 

 ##########
 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) ++
 
 Review comment:
   I don't know why we pick -20000 and 20000 as the boundaries, just to be safe to always test the boundary values.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597598711
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597489287
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/24386/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597598720
 
 
   Test PASSed.
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/119655/
   Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597488679
 
 
   **[Test build #119655 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119655/testReport)** for PR 27873 at commit [`c7819b9`](https://github.com/apache/spark/commit/c7819b9be03b9ac87ae649c7e922ca4994893560).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] SparkQA commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
SparkQA commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597597784
 
 
   **[Test build #119655 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/119655/testReport)** for PR 27873 at commit [`c7819b9`](https://github.com/apache/spark/commit/c7819b9be03b9ac87ae649c7e922ca4994893560).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] MaxGekk commented on a change in pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
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_r391113621
 
 

 ##########
 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:
   It is not related to the PR but I think we could unify random data generators for Catalyst's types. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597598711
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan commented on a change in pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
cloud-fan 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_r391071785
 
 

 ##########
 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:
   Sorry seeing this comment too late.
   
   Here we just need to get a random int. It's nothing about the catalyst data type. I think it's better to keep simple.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597487755
 
 
   cc @MaxGekk @HyukjinKwon 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597489281
 
 
   Merged build finished. Test PASSed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on issue #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873#issuecomment-597711001
 
 
   thanks, merging to master/3.0!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [spark] cloud-fan closed pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #27873: [SPARK-31117][SQL][TEST] reduce the test time of DateTimeUtilsSuite
URL: https://github.com/apache/spark/pull/27873
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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