Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-13191 Add a simplified UDF type extraction
  3. FLINK-18683

Support @DataTypeHint for TableFunction output types

    XMLWordPrintableJSON

Details

    Description

      For ScalarFunctions, the return type of an eval method can be declared with a @DataTypeHint:

      @DataTypeHint("INT")
      public Integer eval(Integer value) {
        return value * 2;
      }

      This does not work for TableFunctions because the @DataTypeHint annotation refers to the void return type. Hence, TableFunction eval() methods must always be annotated with the more complex @FunctionHint method.
      However, I think that context, it is clear that the @DataTypeHint annotation refers to the actual return type of the table function (the type parameter of TableFunction<OUT>).

      We could consider allowing @DataTypeHint annotations also on TableFunction classes (defining the output type of all eval methods) and eval() methods.

      Attachments

        Issue Links

          Activity

            People

              twalthr Timo Walther
              fhueske Fabian Hueske
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: