[
https://issues.apache.org/jira/browse/FLINK-14273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16940708#comment-16940708
]
Jark Wu commented on FLINK-14273:
---------------------------------
Hi [~hailong wang], thanks for reporting this. But why users don't need to care
about accumulator type?
IMO, we should list the full signatures (including accumulator type and *method
name*) to easily map to the methods in user defined function.
> when User-Defined Aggregate Functions(UDAF) parameters are inconsistent with
> the definition, the error reporting is confusing
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-14273
> URL: https://issues.apache.org/jira/browse/FLINK-14273
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Runtime
> Affects Versions: 1.9.0
> Reporter: hailong wang
> Priority: Critical
> Fix For: 1.10.0
>
>
> 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:
> {code:java}
> INSERT INTO Orders SELECT name, USERUDAF(id, name) FROM Orders GROUP BY
> TUMBLE(rowTime, interval '10' second ), id, name
> {code}
> USERUDAF is a User-Defined Aggregate Functions, and accumulate is defined as
> follow:
> {code:java}
> public void accumulate(Long acc, String a) {……}
> {code}
> At present, error is as follows:
> {code:java}
> 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)
> {code}
> This error will mislead users, and the expected errors are as follows :
> {code:java}
> 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){code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)