-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-34152][SQL] Make CreateViewStatement.child to be LogicalPlan's children so that it's resolved in analyze phase #31273
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 all commits
db4dfaf
71c01e8
8dc1961
7becf96
4b3f184
9085d17
f2b86a9
bfabe9f
1f2e4c7
0b75fdc
ac663aa
30e750c
0fbf1cf
a8581c6
4e77301
60cf521
a0ba508
1949cbc
5e38e2b
388ec16
7e92eeb
fbdcf3b
2a3e5b7
e92cbe1
8422ae8
bace91a
9432fec
737307c
d906e19
4e55a1f
e9cd2f3
9da3b9c
e36fc34
b54df8a
c5651b2
d4e958a
84d817c
82d58ba
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 |
|---|---|---|
|
|
@@ -622,8 +622,7 @@ class SessionCatalog( | |
| } | ||
|
|
||
| /** | ||
| * Generate a [[View]] operator from the view description if the view stores sql text, | ||
| * otherwise, it is same to `getRawTempView` | ||
| * Generate a [[View]] operator from the temporary view stored. | ||
imback82 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| */ | ||
| def getTempView(name: String): Option[LogicalPlan] = synchronized { | ||
| getRawTempView(name).map(getTempViewPlan) | ||
|
|
@@ -641,8 +640,7 @@ class SessionCatalog( | |
| } | ||
|
|
||
| /** | ||
| * Generate a [[View]] operator from the view description if the view stores sql text, | ||
| * otherwise, it is same to `getRawGlobalTempView` | ||
| * Generate a [[View]] operator from the global temporary view stored. | ||
| */ | ||
| def getGlobalTempView(name: String): Option[LogicalPlan] = { | ||
| getRawGlobalTempView(name).map(getTempViewPlan) | ||
|
|
@@ -683,7 +681,7 @@ class SessionCatalog( | |
| val table = formatTableName(name.table) | ||
| if (name.database.isEmpty) { | ||
| tempViews.get(table).map { | ||
| case TemporaryViewRelation(metadata) => metadata | ||
| case TemporaryViewRelation(metadata, _) => metadata | ||
| case plan => | ||
|
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. If https://github.com/apache/spark/pull/31273/files#r580757641 is done, |
||
| CatalogTable( | ||
| identifier = TableIdentifier(table), | ||
|
|
@@ -693,7 +691,7 @@ class SessionCatalog( | |
| }.getOrElse(getTableMetadata(name)) | ||
| } else if (formatDatabaseName(name.database.get) == globalTempViewManager.database) { | ||
| globalTempViewManager.get(table).map { | ||
| case TemporaryViewRelation(metadata) => metadata | ||
| case TemporaryViewRelation(metadata, _) => metadata | ||
| case plan => | ||
| CatalogTable( | ||
| identifier = TableIdentifier(table, Some(globalTempViewManager.database)), | ||
|
|
@@ -838,9 +836,11 @@ class SessionCatalog( | |
|
|
||
| private def getTempViewPlan(plan: LogicalPlan): LogicalPlan = { | ||
| plan match { | ||
| case viewInfo: TemporaryViewRelation => | ||
| fromCatalogTable(viewInfo.tableMeta, isTempView = true) | ||
| case v => v | ||
| case TemporaryViewRelation(tableMeta, None) => | ||
| fromCatalogTable(tableMeta, isTempView = true) | ||
| case TemporaryViewRelation(tableMeta, Some(plan)) => | ||
| View(desc = tableMeta, isTempView = true, child = plan) | ||
| case other => other | ||
|
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. If the current PR's approach is fine, we can remove this
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. +1 |
||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.