gengliangwang commented on code in PR #53570:
URL: https://github.com/apache/spark/pull/53570#discussion_r2850272168
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -2064,17 +2377,40 @@ class SessionCatalog(
* Returns whether it is a temporary function. If not existed, returns false.
*/
def isTemporaryFunction(name: FunctionIdentifier): Boolean = {
- // A temporary function is a function that has been registered in
functionRegistry
- // without a database name, and is neither a built-in function nor a Hive
function
- name.database.isEmpty && isRegisteredFunction(name) &&
!isBuiltinFunction(name)
+ // A temporary function is stored with database = TEMP_FUNCTION_DB
+ if (name.database.isEmpty) {
+ val tempIdent = tempFunctionIdentifier(name.funcName)
+ functionRegistry.functionExists(tempIdent) ||
+ tableFunctionRegistry.functionExists(tempIdent)
+ } else {
+ isTempFunctionIdentifier(name)
Review Comment:
should we also check
```
functionRegistry.functionExists(tempIdent) ||
tableFunctionRegistry.functionExists(tempIdent)
```
here?
The `isTempFunctionIdentifier` method checks only the identifier
--
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]