-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34596][SPARK-34607][SQL][FOLLOWUP][TESTS][3.1] Add PlanTest. testFallback and use it
#31764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we have to clone the conf here?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, I thought that this was a tentative workaround.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dongjoon-hyun Can #31775 allow us to revert this?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so. |
||
| new ParVector(ALL_TIMEZONES.toVector).foreach { zid => | ||
| def checkCastWithParseError(str: String): Unit = { | ||
| checkExceptionInExpression[DateTimeException]( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,15 @@ trait CodegenInterpretedPlanTest extends PlanTest { | |
| super.test(testName + " (interpreted path)", testTags: _*)(testFun)(pos) | ||
| } | ||
| } | ||
|
|
||
| protected def testFallback( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to add it, too. |
||
| 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) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: How about adding an additional message here, e.g., |
||
| } | ||
|
Comment on lines
+59
to
+61
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should run twice, one for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds like another use case. Technically, this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe, do you want to add
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. At the second thought, I understand what was your suggestion. So, your suggestion is to check the occurrence of
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll update my PR in this afternoon~
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @viirya . I tried to revise, but it seems strange to me.
As we know, So,
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So it sounds weird that some test cases works only at Wrapping the test function with So, it may unintentionally avoid the test coverage of interpreted path. That means, if we use The current
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, @viirya . It seems that you missed @rednaxelafx 's comment, #31709 (comment) .
|
||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about leaving some comments here about why we need the fallback based on the Kris investigation? #31709 (comment)