Skip to content

[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

Closed
wants to merge 2 commits into from

Conversation

markgrover
Copy link
Member

…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.

…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.
Copy link
Member

@srowen srowen left a 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

@SparkQA
Copy link

SparkQA commented Oct 25, 2016

Test build #67514 has finished for PR 15623 at commit dea1f33.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@markgrover
Copy link
Member Author

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!

@markgrover markgrover changed the title SPARK-18093][SQL] Fix default value test in SQLConfSuite to work rega… [SPARK-18093][SQL] Fix default value test in SQLConfSuite to work rega… Oct 25, 2016
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"))
Copy link
Contributor

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("/")

Copy link
Member

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") {

Copy link
Contributor

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.

@vanzin
Copy link
Contributor

vanzin commented Oct 26, 2016

LGTM will merge once tests pass.

@SparkQA
Copy link

SparkQA commented Oct 26, 2016

Test build #67535 has finished for PR 15623 at commit 707f1ee.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@vanzin
Copy link
Contributor

vanzin commented Oct 26, 2016

Merging to master / 2.0.

asfgit pushed a commit that referenced this pull request Oct 26, 2016
…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>
@asfgit asfgit closed this in 4bee954 Oct 26, 2016
@markgrover markgrover deleted the spark-18093 branch October 27, 2016 00:42
robert3005 pushed a commit to palantir/spark that referenced this pull request Nov 1, 2016
…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.
uzadude pushed a commit to uzadude/spark that referenced this pull request Jan 27, 2017
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants