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

Mihai Budiu resolved CALCITE-7845.
----------------------------------
    Fix Version/s: 1.43.0
       Resolution: Fixed

Fixed in 
[https://github.com/apache/calcite/commit/d3b1487be77a377c61a9976a4427afbb3ec7b0ff]

Thank you for the contribution [[email protected]] 

> UDF/UDTF overload resolution fails when concrete parameter types coexist with 
> ANY
> ---------------------------------------------------------------------------------
>
>                 Key: CALCITE-7845
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7845
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Kirill Tkalenko
>            Assignee: Kirill Tkalenko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.43.0
>
>
> Calcite may throw an {{AssertionError}} when resolving overloaded 
> user-defined functions that combine concrete parameter types with {{Object}} 
> ({{{}ANY{}}}).
> Example:
> {code:java}
> public static String foo(String value) { return "String"; }
> public static String foo(Timestamp value) { return "Timestamp"; }
> public static String foo(Object value) { return "Object"; } {code}
> After registering these overloads under the same SQL name:
> {code:java}
> SELECT foo('text');                          -- expected: String
> SELECT foo(TIMESTAMP '2024-01-02 03:04:05');  -- expected: Timestamp
> SELECT foo(TRUE);                            -- expected: Object {code}
> Expected behavior: prefer a compatible concrete overload and use Object as a 
> fallback, regardless of registration order. Apply the same behavior to scalar 
> UDFs and table functions (UDTFs).



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

Reply via email to