linhongliu-db commented on a change in pull request #34546:
URL: https://github.com/apache/spark/pull/34546#discussion_r747207463



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala
##########
@@ -232,11 +242,16 @@ case class AlterViewAsCommand(
 
   override def childrenToAnalyze: Seq[LogicalPlan] = query :: Nil
 
+  override def applyAnalysisContext(analysisContext: AnalysisContext): 
AnalysisOnlyCommand = {
+    // Collect the referred temporary functions from AnalysisContext
+    copy(referredTempFunctions = 
analysisContext.referredTempFunctionNames.toSeq)
+  }
+
   def markAsAnalyzed(): LogicalPlan = copy(isAnalyzed = true)

Review comment:
       i'm thinking about combining them to
   ```
   def markAsAnalyzed(analysisContext: AnalysisContext): LogicalPlan = {
     copy(
       isAnalyzed = true,
       referredTempFunctions = analysisContext.referredTempFunctionNames.toSeq)
   }
   ```
   
   cannot decide which is better




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