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/03/06 07:47:04 UTC
[GitHub] [spark] dongjoon-hyun opened a new pull request #31764: [WIP] Use fallback
dongjoon-hyun opened a new pull request #31764:
URL: https://github.com/apache/spark/pull/31764
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792009734
> This is WIP because the tests still fail even in Fallback mode.
This is not anymore?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791891338
cc @rednaxelafx and @viirya
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791904404
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40406/
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792026645
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40415/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588932993
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
`test` runs the test code twice, one for codegen and one for interpreted. It is for test coverage.
If `testFallback` only runs for fallback mode, then it might only runs codegen and skips interpreted mode if codegen successes. So the test coverage is less, I think.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791972340
Thank you, @kiszk and @rednaxelafx .
To @kiszk . I need to make the same PR to `master` and `branch-3.1` in order to pass the CI.
> Thank you for creating a WIP. Could you please clarify "make two more PRs"?
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791897728
**[Test build #135824 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135824/testReport)** for PR 31764 at commit [`1a5a015`](https://github.com/apache/spark/commit/1a5a01598e6187d6d67c71988fb4ea6dad5fa081).
* This patch **fails Spark 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.
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] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792052536
I created a PR for master branch.
- https://github.com/apache/spark/pull/31766
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791905855
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40406/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588929140
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
That sounds like another use case. Technically, this `testFallback` is designed to the **default** mode of this configuration (which is the default of Apache Spark runtime in non-testing mode) instead of a specific mode `interpreted mode` or `codeine`.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
kiszk commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589219424
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -961,7 +961,7 @@ abstract class AnsiCastSuiteBase extends CastSuiteBase {
}
test("ANSI mode: cast string to timestamp with parse error") {
- val activeConf = conf
+ val activeConf = conf.clone()
Review comment:
@dongjoon-hyun Can #31775 allow us to revert this?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589091797
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
`FALLBACK` mode is not a special path other than codegen and interpreted path. Under `FALLBACK` mode, Spark runs first codegen path and then interpreted path if codegen fails.
So it sounds weird that some test cases works only at `FALLBACK` mode. Doesn't it just mean the test cases may fail under codegen but can success under interpreted?
Wrapping the test function with `FALLBACK` config, means we may only run the test in codegen path, if codegen path successes. It skips interpreted path in the case.
So, it may unintentionally avoid the test coverage of interpreted path.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun edited a comment on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792540196
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
kiszk commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792535973
@dongjoon-hyun Should we move #31775 for branch-3.1? Then, will you close this PR?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
kiszk commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791893557
Thank you for creating a WIP. Could you please clarify "make two more PRs"?
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791895591
**[Test build #135824 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135824/testReport)** for PR 31764 at commit [`1a5a015`](https://github.com/apache/spark/commit/1a5a01598e6187d6d67c71988fb4ea6dad5fa081).
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791895591
**[Test build #135824 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135824/testReport)** for PR 31764 at commit [`1a5a015`](https://github.com/apache/spark/commit/1a5a01598e6187d6d67c71988fb4ea6dad5fa081).
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792540196
No~, @kiszk . `testFallback` is required for the two test cases of SPARK-34596 and SPARK34607 because we had better **explicitly** use `testFallback` for those test case whose behavior is not runnable in both modes.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589234884
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -961,7 +961,7 @@ abstract class AnsiCastSuiteBase extends CastSuiteBase {
}
test("ANSI mode: cast string to timestamp with parse error") {
- val activeConf = conf
+ val activeConf = conf.clone()
Review comment:
I think so.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589091797
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
`FALLBACK` mode is not a special path other than codegen and interpreted path. Under `FALLBACK` mode, Spark runs first codegen path and then interpreted path if codegen fails.
So it sounds weird that some test cases works only at `FALLBACK` mode, so we only need to run it with `FALLBACK` mode. Doesn't it just mean the test cases may fail under codegen but can success under interpreted?
Wrapping the test function with `FALLBACK` config, means we may only run the test in codegen path, if codegen path successes. It skips interpreted path in the case.
So, it may unintentionally avoid the test coverage of interpreted path. That means, if we use `testFallback`, it might only test codegen path if codegen path successes. Interpreted path will not be tested for the case.
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791995506
**[Test build #135833 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135833/testReport)** for PR 31764 at commit [`ed5c3c0`](https://github.com/apache/spark/commit/ed5c3c0aa37f2e660ec7fafe8ee014716f6ddacc).
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun closed pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31764:
URL: https://github.com/apache/spark/pull/31764
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
kiszk commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792540776
I see.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588928143
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Maybe we should run twice, one for `FALLBACK` and one for `NO_CODEGEN`.
`FALLBACK` will run codegen path first and fallback to interpreted mode if codegen fails. So interpreted mode may not run if codegen mode successes.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588932770
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
I'll update my PR in this afternoon~
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589170423
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
Review comment:
The current test framework assumes that codegen and non-codegen should have consistent behaviors, while this codegen bug breaks the assumption. The test case fails with codegen but passes with non-codegen.
+1 to add this for such test cases. One thing I'm curious about is why this test works in master...
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792016489
Kubernetes integration test status success
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40415/
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792002444
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40415/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
kiszk commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791973223
Thanks. I see. One for `master`. One for `branch-3.1`.
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792071347
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135833/
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791905855
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40406/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] maropu commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589179924
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
Review comment:
nit: How about adding an additional message here, e.g., `testName +" (codegen fallback mode)"`?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589085537
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Hi, @viirya . I tried to revise, but it seems strange to me.
> test runs the test code twice, one for codegen and one for interpreted. It is for test coverage.
> If testFallback only runs for fallback mode, then it might only runs codegen and skips interpreted mode if codegen successes. So the test coverage is less, I think.
`testFallback` is not aiming to replace `test` in [line 41](https://github.com/apache/spark/pull/31764/files#diff-803f946128579a789870dc0bc6f58602db77476f8c04968a72c56efa783c12a1R41). Instead, `testFallback` is added because `PlanTest` bans all derived classes to test `FALLBACK` mode. Before this PR, there is no way to test `FALLBACK` mode.
As we know, `CODEGEN_FACTORY_MODE` has three modes: `FALLBACK`, `CODEGEN_ONLY`, `NO_CODEGEN`.
As we guess in the name, `testFallback`, this test is specifically for `FALLBACK` mode and is added for some test cases which works only at `FALLBACK` mode as @rednaxelafx described.
So, `testFallback` doesn't aim to mean (1) `CODEGEN_ONLY` should fails and (2) `NO_CODEGEN` should passed. If you want to test this (both (1) and (2)), we should make another test function like `testCodegenFailNoCodegenPass`.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588931257
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Hmm. At the second thought, I understand what was your suggestion. So, your suggestion is to check the occurrence of `fallback`, right? Then, it makes sense.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589183759
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Hi, @viirya . It seems that you missed @rednaxelafx 's comment, https://github.com/apache/spark/pull/31709#issuecomment-791275810 .
> So it sounds weird that some test cases works only at FALLBACK mode, so we only need to run it with FALLBACK mode. Doesn't it just mean the test cases may fail under codegen but can success under interpreted?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] maropu commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589179603
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
Review comment:
+1 to add it, too.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] rednaxelafx commented on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
rednaxelafx commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791897476
Thank you very much for helping with the follow-up on this @dongjoon-hyun ! Really appreciate it!
Your proposed fix here look nice.
I've been debugging this on my side as well. There's gotta be something screwing up with the failure (or the lack of failure on 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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792531944
I made a PR for recovering branch-3.1.
- https://github.com/apache/spark/pull/31775
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
cloud-fan commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589168308
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -961,7 +961,7 @@ abstract class AnsiCastSuiteBase extends CastSuiteBase {
}
test("ANSI mode: cast string to timestamp with parse error") {
- val activeConf = conf
+ val activeConf = conf.clone()
Review comment:
do we have to clone the conf here?
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792068000
**[Test build #135833 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135833/testReport)** for PR 31764 at commit [`ed5c3c0`](https://github.com/apache/spark/commit/ed5c3c0aa37f2e660ec7fafe8ee014716f6ddacc).
* 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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792071347
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135833/
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792026645
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40415/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792519186
Hi, All.
Currently, this PR is related two stuff.
1. `testFallback` is designed to clarify the goal of test case.
2. Recovering `branch-3.1`.
For (2), it seems that I found another solution. I'll make another PR for that.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] kiszk commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
kiszk commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589215812
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/CastSuite.scala
##########
@@ -961,7 +961,7 @@ abstract class AnsiCastSuiteBase extends CastSuiteBase {
}
test("ANSI mode: cast string to timestamp with parse error") {
- val activeConf = conf
+ val activeConf = conf.clone()
Review comment:
agree, I thought that this was a tentative workaround.
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791901126
Kubernetes integration test starting
URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40406/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792049197
Yes, this is ready for review, @viirya .
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791995506
**[Test build #135833 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135833/testReport)** for PR 31764 at commit [`ed5c3c0`](https://github.com/apache/spark/commit/ed5c3c0aa37f2e660ec7fafe8ee014716f6ddacc).
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589085537
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Hi, @viirya . I tried to revise, but it seems strange to me.
> test runs the test code twice, one for codegen and one for interpreted. It is for test coverage.
> If testFallback only runs for fallback mode, then it might only runs codegen and skips interpreted mode if codegen successes. So the test coverage is less, I think.
`testFallback` is not aiming to replace `test` in [line 41](https://github.com/apache/spark/pull/31764/files#diff-803f946128579a789870dc0bc6f58602db77476f8c04968a72c56efa783c12a1R41). Instead, `testFallback` is added because `PlanTest` bans all derived classes from testing `FALLBACK` mode. Before this PR, there is no way to test `FALLBACK` mode.
As we know, `CODEGEN_FACTORY_MODE` has three modes: `FALLBACK`, `CODEGEN_ONLY`, `NO_CODEGEN`.
As we guess in the name, `testFallback`, this test is specifically for `FALLBACK` mode and is added for some test cases which works only at `FALLBACK` mode as @rednaxelafx described.
So, `testFallback` doesn't aim to mean (1) `CODEGEN_ONLY` should fails and (2) `NO_CODEGEN` should passed. If you want to test this (both (1) and (2)), we should make another test function like `testCodegenFailNoCodegenPass`.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589091797
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
`FALLBACK` mode is not a special path other than codegen and interpreted path. Under `FALLBACK` mode, Spark runs first codegen path and then interpreted path if codegen fails.
So it sounds weird that some test cases works only at `FALLBACK` mode, so we only need to run it with `FALLBACK` mode. Doesn't it just mean the test cases may fail under codegen but can success under interpreted?
Wrapping the test function with `FALLBACK` config, means we may only run the test in codegen path, if codegen path successes. It skips interpreted path in the case.
So, it may unintentionally avoid the test coverage of interpreted path. That means, if we use `testFallback`, it might only test codegen path if codegen path successes. Interpreted path will not be tested for the case.
The current `testFallback` only makes sense if we only want to make sure the test case works, no matter it is codegen or interpreted mode. If this is the purpose, then it is fine.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun edited a comment on pull request #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun edited a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791891338
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-792541188
Anyway, I'll make this as a draft for now.
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791899102
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135824/
----------------------------------------------------------------
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
---------------------------------------------------------------------
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 #31764: [WIP] Use fallback
Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31764:
URL: https://github.com/apache/spark/pull/31764#issuecomment-791899102
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135824/
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] viirya commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
viirya commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589091797
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
`FALLBACK` mode is not a special path other than codegen and interpreted path. Under `FALLBACK` mode, Spark runs first codegen path and then interpreted path if codegen fails.
So it sounds weird that some test cases works only at `FALLBACK` mode, so we only need to run it with `FALLBACK` mode. Doesn't it just mean the test cases may fail under codegen but can success under interpreted?
Wrapping the test function with `FALLBACK` config, means we may only run the test in codegen path, if codegen path successes. It skips interpreted path in the case.
So, it may unintentionally avoid the test coverage of interpreted path.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] maropu commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
maropu commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r589182718
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala
##########
@@ -214,7 +214,8 @@ class ExpressionEncoderSuite extends CodegenInterpretedPlanTest with AnalysisTes
OuterScopes.addOuterScope(MalformedClassObject)
encodeDecodeTest(
MalformedClassObject.MalformedNameExample(42),
- "nested Scala class should work")
+ "nested Scala class should work",
+ useFallback = true)
Review comment:
How about leaving some comments here about why we need the fallback based on the Kris investigation? https://github.com/apache/spark/pull/31709#issuecomment-791275810
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31764: [SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add `PlanTest. testFallback` and use it
Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31764:
URL: https://github.com/apache/spark/pull/31764#discussion_r588930936
##########
File path: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/plans/PlanTest.scala
##########
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest {
super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos)
}
}
+
+ protected def testFallback(
+ testName: String,
+ testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
+ val codegenMode = CodegenObjectFactoryMode.FALLBACK.toString
+ withSQLConf(SQLConf.CODEGEN_FACTORY_MODE.key -> codegenMode) {
+ super.test(testName, testTags: _*)(testFun)(pos)
+ }
Review comment:
Maybe, do you want to add `testCodegenFail`?
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org