-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-33765][SQL] Migrate UNCACHE TABLE to use UnresolvedRelation to resolve identifier #30743
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,3 +87,16 @@ case class CacheTableAsSelectExec( | |
| sparkSession.table(tempViewName) | ||
| } | ||
| } | ||
|
|
||
| case class UncacheTableExec( | ||
| relation: LogicalPlan, | ||
| cascade: Boolean) extends V2CommandExec { | ||
| override def run(): Seq[InternalRow] = { | ||
| val sparkSession = sqlContext.sparkSession | ||
| val df = Dataset.ofRows(sparkSession, relation) | ||
| sparkSession.sharedState.cacheManager.uncacheQuery(df, cascade) | ||
|
Contributor
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.
Contributor
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. We can do the same to
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. I updated to pass a logical plan instead of dataframe (this required updating more rules, but I think it's "more correct".) I will add a new overload that takes |
||
| Seq.empty | ||
| } | ||
|
|
||
| override def output: Seq[Attribute] = Seq.empty | ||
| } | ||
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.
After a second look, I think it's better to be consistent with INSERT and just say
Table or view not found: xxx. When people run the command, they definitely know which command triggers the table not found issue.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. I will revert other commands as well in a separate PR.