[SPARK-32327][SQL] SHOW TBLPROPERTIES is not allowed on temporary views#29127
[SPARK-32327][SQL] SHOW TBLPROPERTIES is not allowed on temporary views#29127imback82 wants to merge 4 commits intoapache:masterfrom
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.
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.
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