Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12036#discussion_r57943265
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
 ---
    @@ -52,6 +53,15 @@ trait FunctionRegistry {
       /** Drop a function and return whether the function existed. */
       def dropFunction(name: String): Boolean
     
    +  /* Return the FunctionBuilder and ExpressionInfo for the specified 
function name and classname. */
    +  def makeFunctionBuilderAndInfo(
    +    name: String,
    +    functionClassName: String): (ExpressionInfo, FunctionBuilder) = {
    +    val clazz = 
Utils.getContextOrSparkClassLoader.loadClass(functionClassName)
    +    val (_, (info, builder)) =
    +      FunctionRegistry.expression(name, 
clazz.asInstanceOf[Class[Expression]])
    --- End diff --
    
    We shouldn't expose this to the user. The reflection hacks we do down there 
are intended to be for internal use only so we don't want the user to do 
something like:
    ```
    CREATE TEMPORARY FUNCTION my_func AS com.x.y.z.MyFunc
    ```
    where `MyFunc` has the special `Expression` constructors that we expect.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to