cloud-fan commented on code in PR #49389:
URL: https://github.com/apache/spark/pull/49389#discussion_r1904890147
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -1764,26 +1910,58 @@ class SessionCatalog(
* Look up a persistent scalar function by name and resolves it to an
Expression.
*/
def resolvePersistentFunction(
- name: FunctionIdentifier, arguments: Seq[Expression]): Expression = {
- resolvePersistentFunctionInternal(name, arguments, functionRegistry,
makeFunctionBuilder)
+ name: FunctionIdentifier, arguments: Seq[Expression]): Expression = {
Review Comment:
```suggestion
name: FunctionIdentifier, arguments: Seq[Expression]): Expression = {
```
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -1764,26 +1910,58 @@ class SessionCatalog(
* Look up a persistent scalar function by name and resolves it to an
Expression.
*/
def resolvePersistentFunction(
- name: FunctionIdentifier, arguments: Seq[Expression]): Expression = {
- resolvePersistentFunctionInternal(name, arguments, functionRegistry,
makeFunctionBuilder)
+ name: FunctionIdentifier, arguments: Seq[Expression]): Expression = {
+ resolvePersistentFunctionInternal[Expression](
+ name,
+ arguments,
+ functionRegistry,
+ registerHiveFunc = func =>
+ registerFunction(
+ func,
+ overrideIfExists = false,
+ registry = functionRegistry,
+ functionBuilder = makeFunctionBuilder(func)
+ ),
+ registerUserDefinedFunc = function => {
+ val builder = makeUserDefinedScalarFuncBuilder(function)
+ registerUserDefinedFunction[Expression](
+ function = function,
+ overrideIfExists = false,
+ registry = functionRegistry,
+ functionBuilder = builder)
+ }
+ )
}
/**
* Look up a persistent table function by name and resolves it to a
LogicalPlan.
*/
def resolvePersistentTableFunction(
- name: FunctionIdentifier,
- arguments: Seq[Expression]): LogicalPlan = {
- // We don't support persistent table functions yet.
- val builder = (func: CatalogFunction) => failFunctionLookup(name)
- resolvePersistentFunctionInternal(name, arguments, tableFunctionRegistry,
builder)
+ name: FunctionIdentifier,
Review Comment:
```suggestion
name: FunctionIdentifier,
```
--
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]