-
Notifications
You must be signed in to change notification settings - Fork 29.4k
[SPARK-20245][SQL][minor] pass output to LogicalRelation directly #17552
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
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,13 +75,13 @@ class PathOptionSuite extends DataSourceTest with SharedSQLContext { | |
| |USING ${classOf[TestOptionsSource].getCanonicalName} | ||
| |OPTIONS (PATH '/tmp/path') | ||
| """.stripMargin) | ||
| assert(getPathOption("src") == Some("file:/tmp/path")) | ||
| assert(getPathOption("src").map(makeQualifiedPath) == Some(makeQualifiedPath("/tmp/path"))) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes in this test suite are not related to this PR, just to reinforce it. |
||
| } | ||
|
|
||
| // should exist even path option is not specified when creating table | ||
| withTable("src") { | ||
| sql(s"CREATE TABLE src(i int) USING ${classOf[TestOptionsSource].getCanonicalName}") | ||
| assert(getPathOption("src") == Some(CatalogUtils.URIToString(defaultTablePath("src")))) | ||
| assert(getPathOption("src").map(makeQualifiedPath) == Some(defaultTablePath("src"))) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -95,9 +95,9 @@ class PathOptionSuite extends DataSourceTest with SharedSQLContext { | |
| |OPTIONS (PATH '$p') | ||
| |AS SELECT 1 | ||
| """.stripMargin) | ||
| assert(CatalogUtils.stringToURI( | ||
| spark.table("src").schema.head.metadata.getString("path")) == | ||
| makeQualifiedPath(p.getAbsolutePath)) | ||
| assert( | ||
| spark.table("src").schema.head.metadata.getString("path") == | ||
| p.getAbsolutePath) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -109,8 +109,9 @@ class PathOptionSuite extends DataSourceTest with SharedSQLContext { | |
| |USING ${classOf[TestOptionsSource].getCanonicalName} | ||
| |AS SELECT 1 | ||
| """.stripMargin) | ||
| assert(spark.table("src").schema.head.metadata.getString("path") == | ||
| CatalogUtils.URIToString(defaultTablePath("src"))) | ||
| assert( | ||
| makeQualifiedPath(spark.table("src").schema.head.metadata.getString("path")) == | ||
| defaultTablePath("src")) | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -122,13 +123,13 @@ class PathOptionSuite extends DataSourceTest with SharedSQLContext { | |
| |USING ${classOf[TestOptionsSource].getCanonicalName} | ||
| |OPTIONS (PATH '/tmp/path')""".stripMargin) | ||
| sql("ALTER TABLE src SET LOCATION '/tmp/path2'") | ||
| assert(getPathOption("src") == Some("/tmp/path2")) | ||
| assert(getPathOption("src").map(makeQualifiedPath) == Some(makeQualifiedPath("/tmp/path2"))) | ||
| } | ||
|
|
||
| withTable("src", "src2") { | ||
| sql(s"CREATE TABLE src(i int) USING ${classOf[TestOptionsSource].getCanonicalName}") | ||
| sql("ALTER TABLE src RENAME TO src2") | ||
| assert(getPathOption("src2") == Some(CatalogUtils.URIToString(defaultTablePath("src2")))) | ||
| assert(getPathOption("src2").map(makeQualifiedPath) == Some(defaultTablePath("src2"))) | ||
| } | ||
| } | ||
|
|
||
|
|
||
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
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
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
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.
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 sounds like this logics mentioned in the comments is removed by this PR.
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.
good catch! I found this logic is only useful when converting hive tables to data source tables, so I moved the logic there: https://github.com/apache/spark/pull/17552/files#diff-ee66e11b56c21364760a5ed2b783f863R215
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.
Agree.