imback82 commented on a change in pull request #31273:
URL: https://github.com/apache/spark/pull/31273#discussion_r578736852
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala
##########
@@ -443,33 +443,38 @@ case class InsertIntoDir(
}
/**
- * A container for holding the view description(CatalogTable), and the output
of the view. The
- * child should be a logical plan parsed from the `CatalogTable.viewText`,
should throw an error
- * if the `viewText` is not defined.
+ * A container for holding the view description(CatalogTable) and info whether
the view is temporary
+ * or not. If the view description is available, the child should be a logical
plan parsed from the
+ * `CatalogTable.viewText`. Otherwise, the view is a temporary one created
from a dataframe; in this
+ * case, the child must be already resolved.
Review comment:
I was actually meaning when the `View` is created (to explain this
require condition: `require(desc.isDefined || (isTempView && child.resolved))`)
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1101,9 +1116,9 @@ class Analyzer(override val catalogManager:
CatalogManager)
// The view's child should be a logical plan parsed from the
`desc.viewText`, the variable
// `viewText` should be defined, or else we throw an error on the
generation of the View
// operator.
- case view @ View(desc, isTempView, child) if !child.resolved =>
+ case view @ View(Some(desc), isTempView, child) if !child.resolved =>
// Resolve all the UnresolvedRelations and Views in the child.
- val newChild = AnalysisContext.withAnalysisContext(desc) {
+ val newChild = AnalysisContext.withAnalysisContext(desc, isTempView) {
Review comment:
yes, you are right. After `isReferredTempViewName` fix, this is no
longer needed.
----------------------------------------------------------------
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]