Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-11951

Enhance UserDefinedFunction interface to allow more user defined types

    XMLWordPrintableJSON

Details

    Description

      1.Allow UDF & UDTF to access constant parameter values at getReturnType, see similar feature in hive: https://hive.apache.org/javadocs/r2.2.0/api/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.html#initializeAndFoldConstants-org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector:A-

      /**
       * The input arguments are the input arguments which are passed to the eval() method.
       * Only the literal arguments (constant values) are passed to the [[getResultType()]] method.
       * If non-literal arguments appear, it will pass nulls instead.
       *
       * @param arguments arguments of a function call (only literal arguments
       *                  are passed, nulls for non-literal ones)
       * @param argTypes The classes of the arguments of the called eval() method.
       * @return TypeInformation of result type or null if Flink should determine the type
       */
      public TypeInformation<?> getResultType(Object[] arguments, Class<?>[] argTypes)

      2.Allow AggregateFunction to decide its user define inputs types with argClasses.

      /**
       * Returns the result type of the user defined inputs with a given signature.
       */
      public TypeInformation[] getUserDefinedInputTypes(Class[] argTypes)
      

      Attachments

        Issue Links

          Activity

            People

              lzljs3620320 Jingsong Lee
              lzljs3620320 Jingsong Lee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m