singhpk234 commented on code in PR #9675: URL: https://github.com/apache/iceberg/pull/9675#discussion_r1481899840
########## spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteViewCommands.scala: ########## @@ -149,4 +167,20 @@ case class RewriteViewCommands(spark: SparkSession) extends Rule[LogicalPlan] wi None } } + + /** + * Collect the names of all temporary functions. + */ + private def collectTemporaryFunctions(child: LogicalPlan): Seq[String] = { + val tempFunctions = new ArrayBuffer[String]() Review Comment: should this be a hashset instead ? ########## spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteViewCommands.scala: ########## @@ -149,4 +167,20 @@ case class RewriteViewCommands(spark: SparkSession) extends Rule[LogicalPlan] wi None } } + + /** + * Collect the names of all temporary functions. + */ + private def collectTemporaryFunctions(child: LogicalPlan): Seq[String] = { + val tempFunctions = new ArrayBuffer[String]() + child.resolveExpressionsWithPruning(_.containsAnyPattern(UNRESOLVED_FUNCTION)) { + case f@UnresolvedFunction(nameParts, _, _, _, _) if isTempFunction(nameParts.asFunctionIdentifier) => Review Comment: [indentation] ```suggestion case f @ UnresolvedFunction(nameParts, _, _, _, _) if isTempFunction(nameParts.asFunctionIdentifier) => ``` ########## spark/v3.5/spark-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteViewCommands.scala: ########## @@ -83,6 +88,10 @@ case class RewriteViewCommands(spark: SparkSession) extends Rule[LogicalPlan] wi catalogManager.v1SessionCatalog.isTempView(nameParts) } + private def isTempFunction(ident: FunctionIdentifier): Boolean = { Review Comment: [minor] wondering if ViewUtils is a good place for this, thoughts ? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org