rdblue commented on code in PR #9675:
URL: https://github.com/apache/iceberg/pull/9675#discussion_r1483562486
##########
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:
This has a bug that is the same as one I pointed out for checking temp table
references: if the identifier is too long then `asFunctionIdentifier` is going
to throw an exception. `isTempFunction` should be passed `Seq[String]` and
should return `false` if it is too many parts to be a temporary function name.
In addition, this needs to handle names that include the catalog, like
`tabular.system.bucket`.
--
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]