You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2019/10/12 05:55:00 UTC

[jira] [Updated] (FLINK-14273) Improve exception message when signature validation of UDAF is failed

     [ https://issues.apache.org/jira/browse/FLINK-14273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jark Wu updated FLINK-14273:
----------------------------
    Summary: Improve exception message when signature validation of UDAF is failed  (was: when User-Defined Aggregate Functions(UDAF) parameters are inconsistent with the definition, the error reporting is confusing)

> Improve exception message when signature validation of UDAF is failed
> ---------------------------------------------------------------------
>
>                 Key: FLINK-14273
>                 URL: https://issues.apache.org/jira/browse/FLINK-14273
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner
>    Affects Versions: 1.9.0
>            Reporter: hailong wang
>            Assignee: hailong wang
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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)