allisonwang-db commented on a change in pull request #31791:
URL: https://github.com/apache/spark/pull/31791#discussion_r608330253
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
##########
@@ -83,15 +85,94 @@ trait FunctionRegistry {
/** Clear all registered functions. */
def clear(): Unit
+}
- /** Create a copy of this registry with identical functions as this
registry. */
- override def clone(): FunctionRegistry = throw new
CloneNotSupportedException()
+object FunctionRegistryBase {
+
+ /**
+ * Return an expression info and a function builder for the function as
defined by
+ * T using the given name.
+ */
+ def build[T : ClassTag](name: String): (ExpressionInfo, Seq[Expression] =>
T) = {
Review comment:
Please correct me if I am wrong here. Scala doesn't seem to allow
calling the methods in a generic trait unless the class/object extends it and
implements all abstract methods. Since we need to call these methods (build and
expressionInfo) inside the companion objects for FunctionRegistry and
TableFunctionRegistry, they can't be in the `FunctionRegistryBase[T]` trait.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]