imback82 commented on a change in pull request #31273:
URL: https://github.com/apache/spark/pull/31273#discussion_r580757641
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -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
Review comment:
If the current PR's approach is fine, we can remove this `case other =>
other` and change `createTempView` to use `tableDefinition:
TemporaryViewRelation` instead of `tableDefinition: LogicalPlan` once we
migrate `ALTER VIEW AS` and `CREATE TEMP VIEW USING`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]