-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-18093][SQL] Fix default value test in SQLConfSuite to work rega… #15623
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
…rdless of warehouse dir's existence Appending a trailing slash, if there already isn't one for the sake comparison of the two paths. It doesn't take away from the essence of the check, but removes any potential mismatch due to lack of trailing slash.
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.
OK by me. It could go the other way too with def removeTrailingSlash(path: String) = if (path.endsWith("/")) path.init else path
Test build #67514 has finished for PR 15623 at commit
|
Thanks @srowen, indeed, it could be stripping the trailing slash too. I am ok either way too. Let me know if you have strong preference to the other one, otherwise, this should be ok. Thanks again! |
spark.sessionState.conf.warehousePath + "/") | ||
// JVM adds a trailing slash if the directory exists and leaves it as-is, if it doesn't | ||
// In our comparison, add trailing slash to both sides if necessary, to account for both cases | ||
assert(appendTrailingSlashIfNecessary(new Path(Utils.resolveURI("spark-warehouse")) |
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 prefer removing the slash since that's much easier in Scala: str.stripSuffix("/")
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.
Right forgot that one!
@@ -215,12 +215,15 @@ class SQLConfSuite extends QueryTest with SharedSQLContext { | |||
} | |||
|
|||
test("default value of WAREHOUSE_PATH") { | |||
|
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.
nit: shouldn't add this line but I'll clean it during merge.
LGTM will merge once tests pass. |
Test build #67535 has finished for PR 15623 at commit
|
Merging to master / 2.0. |
…rdless of warehouse dir's existence ## What changes were proposed in this pull request? Appending a trailing slash, if there already isn't one for the sake comparison of the two paths. It doesn't take away from the essence of the check, but removes any potential mismatch due to lack of trailing slash. ## How was this patch tested? Ran unit tests and they passed. Author: Mark Grover <mark@apache.org> Closes #15623 from markgrover/spark-18093. (cherry picked from commit 4bee954) Signed-off-by: Marcelo Vanzin <vanzin@cloudera.com>
…rdless of warehouse dir's existence ## What changes were proposed in this pull request? Appending a trailing slash, if there already isn't one for the sake comparison of the two paths. It doesn't take away from the essence of the check, but removes any potential mismatch due to lack of trailing slash. ## How was this patch tested? Ran unit tests and they passed. Author: Mark Grover <mark@apache.org> Closes apache#15623 from markgrover/spark-18093.
…rdless of warehouse dir's existence ## What changes were proposed in this pull request? Appending a trailing slash, if there already isn't one for the sake comparison of the two paths. It doesn't take away from the essence of the check, but removes any potential mismatch due to lack of trailing slash. ## How was this patch tested? Ran unit tests and they passed. Author: Mark Grover <mark@apache.org> Closes apache#15623 from markgrover/spark-18093.
…rdless of warehouse dir's existence
What changes were proposed in this pull request?
Appending a trailing slash, if there already isn't one for the
sake comparison of the two paths. It doesn't take away from
the essence of the check, but removes any potential mismatch
due to lack of trailing slash.
How was this patch tested?
Ran unit tests and they passed.