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 2021/07/06 09:28:29 UTC
[GitHub] [spark] gengliangwang opened a new pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
gengliangwang opened a new pull request #33229:
URL: https://github.com/apache/spark/pull/33229
<!--
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'.
8. If you want to add or modify an error message, please read the guideline first:
https://spark.apache.org/error-message-guidelines.html
-->
### 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.
-->
Some of the test cases in `DateExpressionsSuite` are quite slow:
- `Hour`: 24s
- `Minute`: 26s
- `Day / DayOfMonth`: 8s
- `SPARK-34761,SPARK-35889: add a day-time interval to a timestamp`: 8s
- `Year`: 4s
Each test case has a large loop. We should improve them.
### 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.
-->
Save test running time
### Does this PR introduce _any_ user-facing change?
<!--
Note that it means *any* user-facing change including all aspects such as the documentation fix.
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 possible, please also clarify if this is a user-facing change compared to the released Spark versions or within the unreleased branches such as master.
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.
-->
Verified the run times on local:
- `Hour`: 0.5s
- `Minute`: 0.85s
- `Day / DayOfMonth`: 0.36s
- `SPARK-34761,SPARK-35889: add a day-time interval to a timestamp`: 1.9s
- `Year`: 1.2s
Total reduced time: 65.19s
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on a change in pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33229:
URL: https://github.com/apache/spark/pull/33229#discussion_r664400203
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala
##########
@@ -54,6 +55,13 @@ object DateTimeTestUtils {
"Europe/Amsterdam")
val outstandingZoneIds: Seq[ZoneId] = outstandingTimezonesIds.map(getZoneId)
+ private val random = new Random(System.nanoTime())
+
+ // Take 2 samples from the `outstandingZoneIds`. This is useful when the test case is slow.
Review comment:
Originally, I did this for improving the test case `SPARK-34761,SPARK-35889: add a day-time interval to a timestamp`. But I am fine with your comment
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874835382
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140699/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33229:
URL: https://github.com/apache/spark/pull/33229#discussion_r664397897
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala
##########
@@ -54,6 +55,13 @@ object DateTimeTestUtils {
"Europe/Amsterdam")
val outstandingZoneIds: Seq[ZoneId] = outstandingTimezonesIds.map(getZoneId)
+ private val random = new Random(System.nanoTime())
+
+ // Take 2 samples from the `outstandingZoneIds`. This is useful when the test case is slow.
Review comment:
This might be too much. There are only 9 special timezones in total, and it seems OK to always test all 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874697445
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45210/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874835382
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140699/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874626885
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874626885
**[Test build #140699 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140699/testReport)** for PR 33229 at commit [`3227ca9`](https://github.com/apache/spark/commit/3227ca9ec91965dd216ed5fcaa4379d01f85f736).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang closed pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
gengliangwang closed pull request #33229:
URL: https://github.com/apache/spark/pull/33229
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] AmplabJenkins commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874697445
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/45210/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
MaxGekk commented on a change in pull request #33229:
URL: https://github.com/apache/spark/pull/33229#discussion_r664452157
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -122,8 +124,8 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(2000 to 2002).foreach { y =>
(0 to 11 by 11).foreach { m =>
c.set(y, m, 28)
- (0 to 5 * 24).foreach { i =>
- c.add(Calendar.HOUR_OF_DAY, 1)
+ (0 to 12).foreach { i =>
Review comment:
Where is `i` used?
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -122,8 +124,8 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(2000 to 2002).foreach { y =>
(0 to 11 by 11).foreach { m =>
c.set(y, m, 28)
- (0 to 5 * 24).foreach { i =>
- c.add(Calendar.HOUR_OF_DAY, 1)
+ (0 to 12).foreach { i =>
Review comment:
Why? What is the reason to test the same `HOUR_OF_DAY ` multiple times?
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -122,8 +124,8 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(2000 to 2002).foreach { y =>
(0 to 11 by 11).foreach { m =>
c.set(y, m, 28)
- (0 to 5 * 24).foreach { i =>
- c.add(Calendar.HOUR_OF_DAY, 1)
+ (0 to 12).foreach { i =>
Review comment:
ah, I see. Thanks.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on a change in pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on a change in pull request #33229:
URL: https://github.com/apache/spark/pull/33229#discussion_r664400203
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala
##########
@@ -54,6 +55,13 @@ object DateTimeTestUtils {
"Europe/Amsterdam")
val outstandingZoneIds: Seq[ZoneId] = outstandingTimezonesIds.map(getZoneId)
+ private val random = new Random(System.nanoTime())
+
+ // Take 2 samples from the `outstandingZoneIds`. This is useful when the test case is slow.
Review comment:
Originally, I did this for improving the test case `SPARK-34761,SPARK-35889: add a day-time interval to a timestamp`. But I am fine with your comment
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -122,8 +124,8 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(2000 to 2002).foreach { y =>
(0 to 11 by 11).foreach { m =>
c.set(y, m, 28)
- (0 to 5 * 24).foreach { i =>
- c.add(Calendar.HOUR_OF_DAY, 1)
+ (0 to 12).foreach { i =>
Review comment:
It is not used.
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/DateExpressionsSuite.scala
##########
@@ -122,8 +124,8 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
(2000 to 2002).foreach { y =>
(0 to 11 by 11).foreach { m =>
c.set(y, m, 28)
- (0 to 5 * 24).foreach { i =>
- c.add(Calendar.HOUR_OF_DAY, 1)
+ (0 to 12).foreach { i =>
Review comment:
> Why? What is the reason to test the same HOUR_OF_DAY multiple times?
The HOUR_OF_DAY is increasing in the loop. I am simply following the original logic.
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #33229:
URL: https://github.com/apache/spark/pull/33229#discussion_r664397897
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/util/DateTimeTestUtils.scala
##########
@@ -54,6 +55,13 @@ object DateTimeTestUtils {
"Europe/Amsterdam")
val outstandingZoneIds: Seq[ZoneId] = outstandingTimezonesIds.map(getZoneId)
+ private val random = new Random(System.nanoTime())
+
+ // Take 2 samples from the `outstandingZoneIds`. This is useful when the test case is slow.
Review comment:
This might be too much. There are only 9 special timezones in total, and it seems OK to always test all 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874805514
**[Test build #140699 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140699/testReport)** for PR 33229 at commit [`3227ca9`](https://github.com/apache/spark/commit/3227ca9ec91965dd216ed5fcaa4379d01f85f736).
* This patch **fails SparkR unit 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] SparkQA commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874658075
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/45210/
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] gengliangwang commented on pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
gengliangwang commented on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874709125
Merging to master and branch-3.2(in case of future code conflicts in DateExpressionsSuite since we are working on new interval and timestmap 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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
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 pull request #33229: [SPARK-36025][SQL][TESTS] Reduce the run time of DateExpressionsSuite
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #33229:
URL: https://github.com/apache/spark/pull/33229#issuecomment-874626885
**[Test build #140699 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140699/testReport)** for PR 33229 at commit [`3227ca9`](https://github.com/apache/spark/commit/3227ca9ec91965dd216ed5fcaa4379d01f85f736).
--
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.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org