Class ScalarFunctionImpl

    • Constructor Detail

      • ScalarFunctionImpl

        private ScalarFunctionImpl​(java.lang.reflect.Method method,
                                   CallImplementor implementor)
        Private constructor.
    • Method Detail

      • createAll

        public static com.google.common.collect.ImmutableMultimap<java.lang.String,​ScalarFunction> createAll​(java.lang.Class<?> clazz)
        Creates ScalarFunction for each method in a given class.
      • create

        public static ScalarFunction create​(java.lang.Class<?> clazz,
                                            java.lang.String methodName)
        Creates ScalarFunction from given class.

        If a method of the given name is not found or it does not suit, returns null.

        Parameters:
        clazz - class that is used to implement the function
        methodName - Method name (typically "eval")
        Returns:
        created ScalarFunction or null
      • create

        public static ScalarFunction create​(java.lang.reflect.Method method)
        Creates ScalarFunction from given method. When eval method does not suit, null is returned.
        Parameters:
        method - method that is used to implement the function
        Returns:
        created ScalarFunction or null
      • createUnsafe

        public static ScalarFunction createUnsafe​(java.lang.reflect.Method method)
        Creates unsafe version of ScalarFunction from any method. The method does not need to be static or belong to a class with default constructor. It is the responsibility of the underlying engine to initialize the UDF object that contain the method.
        Parameters:
        method - method that is used to implement the function
      • createImplementor

        private static CallImplementor createImplementor​(java.lang.reflect.Method method)
      • getNullPolicy

        private static NullPolicy getNullPolicy​(java.lang.reflect.Method m)