vladimirg-db commented on code in PR #53570:
URL: https://github.com/apache/spark/pull/53570#discussion_r2685556320
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -78,10 +79,17 @@ trait FunctionRegistryBase[T] {
/* Create or replace a temporary function. */
final def createOrReplaceTempFunction(
name: String, builder: FunctionBuilder, source: String): Unit = {
- registerFunction(
- FunctionIdentifier(name),
- builder,
- source)
+ // Internal functions (source="internal") are NOT qualified with
+ // CatalogManager.SESSION_NAMESPACE database because they use a separate
+ // internal registry and are resolved differently
+ val identifier = if (source == "internal") {
+ FunctionIdentifier(name)
+ } else {
+ // Regular temporary functions are qualified with
CatalogManager.SESSION_NAMESPACE
+ // to enable coexistence with builtin functions of the same name
+ FunctionIdentifier(name, Some(CatalogManager.SESSION_NAMESPACE))
Review Comment:
`ResolverGuard`'s `checkUnresolvedFunction` also depends on the fact that
built-in functions have one-part name.
--
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]