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

Martijn Visser updated FLINK-41476:
-----------------------------------
    Affects Version/s: 1.20.5
                       2.2.1
                       2.3.0

> Calling a procedure with primitive varargs fails with ArrayStoreException
> -------------------------------------------------------------------------
>
>                 Key: FLINK-41476
>                 URL: https://issues.apache.org/jira/browse/FLINK-41476
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 2.3.0, 2.2.1, 1.20.5
>            Reporter: Martijn Visser
>            Priority: Major
>
> Calling a procedure whose call method takes primitive varargs fails. For a 
> procedure with call(ProcedureContext context, double... d), CALL p(1.5e0, 
> 2.5e0) fails with:
> {code}
> java.lang.ArrayStoreException: arraycopy: type mismatch: can not copy object 
> array[] into double[]
> {code}
> PlannerCallProcedureOperation#invokeCallMethod copies the converted arguments 
> into the varargs array with System.arraycopy, which only works for object 
> arrays. The same happens when the class also has call(ProcedureContext, 
> Integer, Integer): CALL p(1, 2) picks the varargs method instead of the exact 
> match and fails the same way.
> We should fill primitive varargs element by element, and prefer a fixed-arity 
> method when one matches.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to