cloud-fan commented on code in PR #53638:
URL: https://github.com/apache/spark/pull/53638#discussion_r2664344722
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveCatalogs.scala:
##########
@@ -126,6 +134,32 @@ class ResolveCatalogs(val catalogManager: CatalogManager)
}
}
+ /**
+ * Resolves a function identifier, checking for builtin and temp functions
first.
+ * Builtin and temp functions are only registered with unqualified names.
+ */
+ private def resolveFunctionIdentifier(
+ nameParts: Seq[String],
+ origin: Origin): ResolvedIdentifier = CurrentOrigin.withOrigin(origin) {
+ if (nameParts.length == 1) {
+ val funcName = FunctionIdentifier(nameParts.head)
+ val sessionCatalog = catalogManager.v1SessionCatalog
+ if (sessionCatalog.isBuiltinFunction(funcName)) {
+ val ident = Identifier.of(Array(CatalogManager.BUILTIN_NAMESPACE),
nameParts.head)
+ ResolvedIdentifier(FakeSystemCatalog, ident)
Review Comment:
It's a virtual catalog to help `ResolvedIdentifier` represent fully
qualified names for temp/builtin objects. Otherwise the v2 command framework
can't work with them. You can check the usage of `FakeSystemCatalog`, it has
been used in a few places already.
--
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]