[ 
https://issues.apache.org/jira/browse/CALCITE-7845?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125575#comment-18125575
 ] 

Julian Hyde commented on CALCITE-7845:
--------------------------------------

Don't use "Fix" in the summary. Describe the problem.

> Fix UDF/UDTF overload resolution with generic parameter types
> -------------------------------------------------------------
>
>                 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
>
> 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
(v8.20.10#820010)

Reply via email to