-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22676][FOLLOW-UP] fix code style for test. #21091
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
Conversation
|
Jenkins, test this please. |
|
Test build #89481 has finished for PR 21091 at commit
|
|
cc @cloud-fan |
|
|
||
| sql("DROP TABLE IF EXISTS table_with_partition") | ||
| sql("DROP TABLE IF EXISTS createAndInsertTest") | ||
| withSQLConf((SQLConf.HIVE_VERIFY_PARTITION_PATH.key -> "true")) { |
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.
we only need one pair of ()
| withTempView("testData") { | ||
| withTable("table_with_partition", "createAndInsertTest") { | ||
| withTempPath { tmpDir => | ||
| tmpDir.mkdir() |
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.
withTempDir, then you don't need to call mkdir here
|
|
||
| // test for the exist path | ||
| checkAnswer(sql("select key,value from table_with_partition"), | ||
| testData.union(testData).union(testData).union(testData).collect) |
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.
no need to call collect, checkAnswer can compare 2 dataframes
59edf82 to
e9ff4d0
Compare
|
Test build #89543 has finished for PR 21091 at commit
|
|
Test build #89541 has finished for PR 21091 at commit
|
| } | ||
| } | ||
|
|
||
| test("Replace spark.sql.hive.verifyPartitionPath by spark.files.ignoreMissingFiles") { |
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.
These 2 tests are exactly same except the config, can we create a common method for it?
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 extracted a common method, check again.
4838b79 to
e9ff4d0
Compare
|
Test build #89562 has finished for PR 21091 at commit
|
|
thanks, merging to master! |
|
Thanks for merging ! |
What changes were proposed in this pull request?
This pr address comments in #19868 ;
Fix the code style for
org.apache.spark.sql.hive.QueryPartitionSuiteby using:withTempView,withTempDir,withTable...