You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Alessandro Solimando (Jira)" <ji...@apache.org> on 2025/03/22 05:27:00 UTC

[jira] [Commented] (CALCITE-6905) Comparing string and int produce exception

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

Alessandro Solimando commented on CALCITE-6905:
-----------------------------------------------

[~drugxander] thanks for reporting, can you share the plans for the query (original and optimized, if any?). I suspect there is a missing cast that type coercion failed to introduce at validation time.

> Comparing string and int produce exception
> ------------------------------------------
>
>                 Key: CALCITE-6905
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6905
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.39.0
>            Reporter: Alexander Drugov
>            Priority: Major
>
> With java class
> {code:java}
> public class Employee {
>   public String id
>   ...
> }{code}
> {code:sql}
> select * from employees e where e.id = 1{code}
> This query produce {_}java.lang.NoSuchMethodException: org.apache.calcite.runtime.SqlFunctions.eq(java.lang.String, int){_}. But this worked at 1.38 version.
>  
> However I successfully can execute:
> {code:sql}
> with t as (
>   select '123' id
> )
> select id from t where id = 123
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)