hailong wang created FLINK-14273:
------------------------------------
Summary: 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
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)