cloud-fan commented on a change in pull request #34929:
URL: https://github.com/apache/spark/pull/34929#discussion_r779612590



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
##########
@@ -1012,6 +1016,24 @@ class Analyzer(override val catalogManager: 
CatalogManager)
         // inside a view maybe resolved incorrectly.
         checkAnalysis(newChild)
         view.copy(child = newChild)
+      case view @ View(_, _, child) =>
+        // Refresh CTE IDs in view's child that has been analyzed with a 
different AnalysisContext.

Review comment:
       ```
   // This is DataFrame view, not SQL view. We need to refresh the CTE IDs in 
view's child,
   // as it's already resolved but the CTE IDs may conflict with the main query.
   ```




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to