[SPARK-38316][SQL][TESTS] Fix SQLViewSuite/TriggerAvailableNowSuite/Unwrap*Suite under ANSI mode#35652
Closed
gengliangwang wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-38316][SQL][TESTS] Fix SQLViewSuite/TriggerAvailableNowSuite/Unwrap*Suite under ANSI mode#35652gengliangwang wants to merge 3 commits intoapache:masterfrom
gengliangwang wants to merge 3 commits intoapache:masterfrom
Conversation
cloud-fan
reviewed
Feb 25, 2022
| def verifyCastBoolean(df: DataFrame, query: String, answer: Seq[Row]): Unit = | ||
| if (conf.ansiEnabled) { | ||
| intercept[AnalysisException] { | ||
| df.where(query).collect() |
Contributor
There was a problem hiding this comment.
It looks meaningless to test ansi error behavior in this optimizer rule test suite. Can we simply turn off ansi in this test case?
cloud-fan
reviewed
Feb 25, 2022
| val q = startQuery() | ||
|
|
||
| def makeDataFrame(a: Seq[Int]): DataFrame = if (SQLConf.get.ansiEnabled) { | ||
| a.map(_.toLong).toDF() |
Contributor
There was a problem hiding this comment.
Can we always use .toLong in this test?
Member
Author
There was a problem hiding this comment.
This is for making the expected answer of Long union String
Contributor
There was a problem hiding this comment.
hmm, this streaming test wants to check Long union String?
Member
Author
There was a problem hiding this comment.
ok, let's update the test case instead
gengliangwang
commented
Feb 25, 2022
| .text(src.getCanonicalPath) | ||
|
|
||
| val df2 = testSource.toDF | ||
| val df2 = testSource.toDF.selectExpr("cast(value as string)") |
Member
Author
There was a problem hiding this comment.
explicit cast as string so that we don't need to concern the type coercion result of long union string
HyukjinKwon
approved these changes
Feb 25, 2022
cloud-fan
approved these changes
Feb 25, 2022
HeartSaVioR
approved these changes
Feb 25, 2022
Member
Author
|
@cloud-fan @HyukjinKwon @HeartSaVioR Thanks for the reviews! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Fix the following test suites under ANSI mode:
Why are the changes needed?
To set up a new GA test job with ANSI mode on
Does this PR introduce any user-facing change?
No
How was this patch tested?
Manually turn on ANSI mode and test .
Also it should pass GA tests.