cloud-fan commented on a change in pull request #30567:
URL: https://github.com/apache/spark/pull/30567#discussion_r535872143
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala
##########
@@ -797,26 +802,24 @@ class SessionCatalog(
val multiParts = Seq(CatalogManager.SESSION_CATALOG_NAME, db, table)
if (metadata.tableType == CatalogTableType.VIEW) {
- val viewText = metadata.viewText.getOrElse(sys.error("Invalid view
without text."))
- val viewConfigs = metadata.viewSQLConfigs
- val viewPlan =
SQLConf.withExistingConf(View.effectiveSQLConf(viewConfigs)) {
- parser.parsePlan(viewText)
- }
-
- logDebug(s"'$viewText' will be used for the view($table) with configs:
$viewConfigs.")
// The relation is a view, so we wrap the relation by:
// 1. Add a [[View]] operator over the relation to keep track of the
view desc;
// 2. Wrap the logical plan in a [[SubqueryAlias]] which tracks the name
of the view.
- val child = View(
- desc = metadata,
- output = metadata.schema.toAttributes,
- child = viewPlan)
+ val child = View.fromCatalogTable(metadata, isTempView = false, parser)
SubqueryAlias(multiParts, child)
} else {
SubqueryAlias(multiParts, UnresolvedCatalogRelation(metadata, options))
}
}
+ def getTempViewPlan(plan: LogicalPlan): LogicalPlan = {
Review comment:
this can be private.
----------------------------------------------------------------
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]