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-19598][SQL]Remove the alias parameter in UnresolvedRelation #16956
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
94084bd
[SPARK-19598][SQL]remove the alias parameter in UnresolvedRelation
windpiger 4023727
fix a bug
windpiger 3c4be76
fix a code style
windpiger 1421481
fix a bug
windpiger accd3b9
rm whitespace
windpiger d2864b6
recover the order of analysis sample and alias
windpiger File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -179,7 +179,7 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with Logging { | |
} | ||
|
||
InsertIntoTable( | ||
UnresolvedRelation(tableIdent, None), | ||
UnresolvedRelation(tableIdent), | ||
partitionKeys, | ||
query, | ||
ctx.OVERWRITE != null, | ||
|
@@ -645,17 +645,21 @@ class AstBuilder extends SqlBaseBaseVisitor[AnyRef] with Logging { | |
* }}} | ||
*/ | ||
override def visitTable(ctx: TableContext): LogicalPlan = withOrigin(ctx) { | ||
UnresolvedRelation(visitTableIdentifier(ctx.tableIdentifier), None) | ||
UnresolvedRelation(visitTableIdentifier(ctx.tableIdentifier)) | ||
} | ||
|
||
/** | ||
* Create an aliased table reference. This is typically used in FROM clauses. | ||
*/ | ||
override def visitTableName(ctx: TableNameContext): LogicalPlan = withOrigin(ctx) { | ||
val table = UnresolvedRelation( | ||
visitTableIdentifier(ctx.tableIdentifier), | ||
Option(ctx.strictIdentifier).map(_.getText)) | ||
table.optionalMap(ctx.sample)(withSample) | ||
val table = UnresolvedRelation(visitTableIdentifier(ctx.tableIdentifier)) | ||
|
||
val tableWithAlias = Option(ctx.strictIdentifier).map(_.getText) match { | ||
case Some(strictIdentifier) => | ||
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. This should be kept in the last line 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. yes, I can not modify the original default expression order between alias and and sample. |
||
SubqueryAlias(strictIdentifier, table, None) | ||
case _ => table | ||
} | ||
tableWithAlias.optionalMap(ctx.sample)(withSample) | ||
} | ||
|
||
/** | ||
|
This file contains 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 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 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 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 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 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.
actually you can't remove this case entirely. you still need to match on UnresolvedRelation, but just use
r.tableIdentifier.table
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.
oh, yes, remove the case will miss the hint on table without alias