pan3793 commented on code in PR #53531:
URL: https://github.com/apache/spark/pull/53531#discussion_r2641716009
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala:
##########
@@ -91,7 +91,7 @@ trait FunctionRegistryBase[T] {
def listFunction(): Seq[FunctionIdentifier]
/* Get the class of the registered function by specified name. */
- def lookupFunction(name: FunctionIdentifier): Option[ExpressionInfo]
+ def lookupFunction(name: FunctionIdentifier): Option[(ExpressionInfo,
FunctionBuilder)]
Review Comment:
I thought that too, but decided not to do that because there are different
type aliases that have the same name `FunctionBuilder`
```
trait FunctionRegistryBase[T] {
type FunctionBuilder = Seq[Expression] => T
}
trait FunctionRegistry extends FunctionRegistryBase[Expression]
trait TableFunctionRegistry extends FunctionRegistryBase[LogicalPlan]
```
```
object FunctionRegistry {
type FunctionBuilder = Seq[Expression] => Expression
}
```
And I have to define `FunctionBuilder` in `V1Function` like this
```
object V1Function {
type FunctionBuilder = Seq[Expression] => TreeNode[_]
}
```
then using `V1Function` anywhere means we can't benefit from the generic
type check and have to use explicit cast in many places
--
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]