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

Konstantin commented on CALCITE-6288:
-------------------------------------

[~julianhyde] Can you suggest how to fix it?
We are storing only String values in +params+ column, and it has type 
+java.util.Map+, but we cannot specify type for it.

> Error while compiling LIKE function after update to 1.36
> --------------------------------------------------------
>
>                 Key: CALCITE-6288
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6288
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.36.0
>            Reporter: Konstantin
>            Priority: Major
>         Attachments: Error.txt, NormalGenCode.txt, 
> image-2024-03-04-12-02-53-920.png, image-2024-03-04-12-03-15-637.png
>
>
> After update to calcite v1.36 we are getting the following error on execution 
> of the following query:
> {code:sql}
> SELECT * FROM "calls_m" WHERE "params"['web.url'] LIKE '%resign%';
> {code}
> {code:java}
>  -> CompileException: Line 16, Column 174: No applicable constructor/method 
> found for actual parameters "java.lang.Object, java.lang.String"; candidates 
> are: "public boolean 
> org.apache.calcite.runtime.SqlFunctions$LikeFunction.like(java.lang.String, 
> java.lang.String, java.lang.String)", "public boolean 
> org.apache.calcite.runtime.SqlFunctions$LikeFunction.like(java.lang.String, 
> java.lang.String)"
> {code}
>  [^Error.txt] 
> In v.1.33 it was working fine.
> Generated code from v1.33:
>  [^NormalGenCode.txt] 
> So, in 1.33 it was calling:
> {code:java}
> Boolean.valueOf(org.apache.calcite.runtime.SqlFunctions.like(item_value == 
> null ? (String) null : item_value.toString(), "%resign%"));
> {code}
> but in 1.36 it's:
> {code:java}
> Boolean.valueOf($L4J$C$new_org_apache_calcite_runtime_SqlFunctions_LikeFunction_.like(item_value,
>  "%resign%"));
> {code}
> So, it's not calling +toString()+ anymore.
> Looks like it's because it's using reflective implementor instead of method 
> implementor:
> v.1.33
>  !image-2024-03-04-12-02-53-920.png! 
> v.1.36
>  !image-2024-03-04-12-03-15-637.png! 
> org.apache.calcite.adapter.enumerable.RexImpTable.Builder
> Table DDL:
> {code:sql}
> CREATE TABLE "profiler"."calls_m" (
>       "start_timestamp" TIMESTAMP(3) NOT NULL NOT NULL,
>       "method_id" JavaType(long) NOT NULL NOT NULL,
>       "method_name" JavaType(class java.lang.String),
>       "duration" JavaType(int) NOT NULL NOT NULL,
>       "cpu_time" JavaType(long) NOT NULL NOT NULL,
>       "suspend_duration" JavaType(int) NOT NULL NOT NULL,
>       "queue_wait_duration" JavaType(int) NOT NULL NOT NULL,
>       "memory_used" JavaType(long) NOT NULL NOT NULL,
>       "calls" JavaType(int) NOT NULL NOT NULL,
>       "transactions" JavaType(long) NOT NULL NOT NULL,
>       "logs_generated" JavaType(int) NOT NULL NOT NULL,
>       "logs_written" JavaType(int) NOT NULL NOT NULL,
>       "file_read" JavaType(long) NOT NULL NOT NULL,
>       "file_written" JavaType(long) NOT NULL NOT NULL,
>       "net_read" JavaType(long) NOT NULL NOT NULL,
>       "net_written" JavaType(long) NOT NULL NOT NULL,
>       "node_name" JavaType(class java.lang.String),
>       "thread_name" JavaType(class java.lang.String),
>       "dump_dir_id" JavaType(int) NOT NULL NOT NULL,
>       "trace_id" JavaType(class 
> com.netcracker.profiler.calcite.trace.TraceId),
>       "profiler_url" JavaType(class java.lang.String),
>       "params" JavaType(interface java.util.Map)
> );
> {code}



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

Reply via email to