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

Improve exception message when signature validation of UDAF is failed

    XMLWordPrintableJSON

Details

    Description

      When UDAF parameters are inconsistent with the definition of accumulate method, all arguments to the accumulate method are listed in the error. But the first argument of accumulate is accumulator, users don't have to care when using SQL.

      For example:

      INSERT INTO Orders SELECT name, USERUDAF(id, name) FROM Orders GROUP BY TUMBLE(rowTime, interval '10' second ), id, name
      

      USERUDAF is a User-Defined Aggregate Functions, and accumulate is defined as follow:

      public void accumulate(Long acc, String a) {……}
      

      At present, error is as follows:

      Caused by: org.apache.flink.table.api.ValidationException: Given parameters of function do not match any signature. 
      Actual: (java.lang.Integer, java.lang.String) 
      Expected: (java.lang.Integer, java.lang.String)
      

      This error will mislead users, and the expected errors are as follows :

      Caused by: org.apache.flink.table.api.ValidationException: Given parameters of function do not match any signature. 
      Actual: (java.lang.Integer, java.lang.String) 
      Expected: (java.lang.String)

      Attachments

        Issue Links

          Activity

            People

              hailong wang hailong wang
              hailong wang hailong wang
              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