-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-43945][SQL][TESTS] Fix bug for SQLQueryTestSuite
when run on local env
#41431
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
[SPARK-43945][SQL][TESTS] Fix bug for SQLQueryTestSuite
when run on local env
#41431
Conversation
[info] - identifier-clause.sql *** FAILED *** (809 milliseconds) |
What's the bug? Mind elabourating it in the PR description? |
@panbingkun Can we just enhance spark/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala Lines 42 to 57 in 6f593be
And I think this one worth file a new Jira |
@panbingkun Thank you for the fix. It seems it's not the issue of |
Ok, Let me do it. |
Ok, Very good proposal, let me do it. |
|
Thank you for your investigation. If so, it seems just set the |
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.
It looks worthy for a JIRA. please file a JIRA for this stuff for trace-ability, @panbingkun .
OK. |
@panbingkun I tested with the below command and it works fine. I think we should just update the document of |
s" for query #$i\n${expected.sql}") { | ||
output.output | ||
} | ||
} | ||
} | ||
|
||
private def normalizeOwner(plan: String): String = { | ||
plan.replaceAll("""Owner\t\{runner}""", "Owner\t" + Utils.getCurrentUserName) | ||
} |
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.
I know this work is OK. But it introduce the extra complexity and readability.
Export |
SQLQueryTestSuite
when run on local env
This is all done! @HyukjinKwon @dongjoon-hyun @LuciferYang @beliefer |
Seems fine. |
@panbingkun can you test this change? May need additional check for Maven's testing |
@@ -49,6 +49,7 @@ trait SQLQueryTestHelper extends Logging { | |||
.replaceAll("Created By.*", s"Created By $notIncludedMsg") | |||
.replaceAll("Created Time.*", s"Created Time $notIncludedMsg") | |||
.replaceAll("Last Access.*", s"Last Access $notIncludedMsg") | |||
.replaceAll("Owner.*", s"Owner $notIncludedMsg") |
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.
This change seems good to me too. @panbingkun Thank you!
Let's waiting ci ~ |
+1, LGTM. Merging to master. |
… local env ### What changes were proposed in this pull request? The pr aims to fix bug for SQLQueryTestSuite when run on local env. When SQLQueryTestSuite runs `identifier-clause.sql` in various different environments, the statement `DESCRIBE SCHEMA IDENTIFIER('id' || 'ent')` will generate different `Owner` values. Currently, this value(`runner`) is OK when runs on GA, but it will fail on local. In order to be compatible with the results of various different environments, the `Owner` value is removed for comparison. ### Why are the changes needed? Fix bugs and compatibility. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - Manually test. - Pass GA. Closes apache#41431 from panbingkun/fix_SQLQueryTestSuite_run_on_local. Authored-by: panbingkun <pbk1982@gmail.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
What changes were proposed in this pull request?
The pr aims to fix bug for SQLQueryTestSuite when run on local env.
When SQLQueryTestSuite runs
identifier-clause.sql
in various different environments, the statementDESCRIBE SCHEMA IDENTIFIER('id' || 'ent')
will generate differentOwner
values. Currently, this value(runner
) is OK when runs on GA, but it will fail on local. In order to be compatible with the results of various different environments, theOwner
value is removed for comparison.Why are the changes needed?
Fix bugs and compatibility.
Does this PR introduce any user-facing change?
No.
How was this patch tested?