-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-32327][SQL] SHOW TBLPROPERTIES is not allowed on temporary views #29127
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-32327][SQL] SHOW TBLPROPERTIES is not allowed on temporary views #29127
Conversation
|
Test build #125923 has finished for PR 29127 at commit
|
| val catalog = sparkSession.sessionState.catalog | ||
| if (catalog.isTemporaryTable(table)) { | ||
| Seq.empty[Row] | ||
| throw new AnalysisException(s"SHOW TBLPROPERTIES is not allowed on a temporary view: $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.
This will not be hit if you go thru SHOW TBLPROPERTIES command.
|
cc: @cloud-fan @viirya |
| * Holds the name of a table or a permanent/temporary view that has yet to be looked up in | ||
| * a catalog. It will be resolved to [[ResolvedTable]] or [[ResolvedView]] during analysis. | ||
| */ | ||
| case class UnresolvedTableOrView(multipartIdentifier: Seq[String]) extends LeafNode { |
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.
shall we simply add an acceptTempView flag here instead of adding UnresolvedTableOrPermanentView?
|
At first glance, I thought the PR description is confusing, because we can specify properties of temp view but can't display it. Then I realized that we just ignore the properties when creating temp views. I think we should fail the temp view creating instead of silently ignoring the table properties when specified. @imback82 can you fix this first? |
Will do. |
|
Test build #126446 has finished for PR 29127 at commit
|
|
Yes, I agree. I will close this for now. Thanks! |
What changes were proposed in this pull request?
This PR proposes to disallow
SHOW TBLPROPERTIESon a temporary view as discussed here: #28375 (comment).Why are the changes needed?
Creating temporary views with properties is not allowed, and
SHOW TBLPROPERTIESon temporary views can also be disabled to be consistent.Does this PR introduce any user-facing change?
Yes,
Before:
After:
How was this patch tested?
Updated existing tests