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

Aleksey Plekhanov resolved IGNITE-23004.
----------------------------------------
    Fix Version/s: 2.17
     Release Note: SQL Calcite: Fixed complex key index scans (binary objects 
comparison)
         Assignee: Aleksey Plekhanov
       Resolution: Fixed

[~NIzhikov], thanks for the review! Merged to master.

> Calcite engine. Multi-node index scan fails on index with binary object field
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-23004
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23004
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>             Fix For: 2.17
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Reproducer:
> {code:java}
> public class IndexScanMultiNodeIntegrationTest extends 
> AbstractBasicIntegrationTest {
>     /** */
>     @Test
>     public void testComplexKeyScan() {
>         IgniteCache<EmployerKey, Employer> emp = client.getOrCreateCache(
>             new CacheConfiguration<EmployerKey, Employer>("emp")
>                 .setSqlSchema("PUBLIC")
>                 .setQueryEntities(F.asList(new QueryEntity(EmployerKey.class, 
> Employer.class).setTableName("emp")))
>         );
>         for (int i = 0; i < 100; i++)
>             emp.put(new EmployerKey(i, i), new Employer("emp" + i, 
> (double)i));
>         assertQuery("SELECT /*+ FORCE_INDEX(\"_key_PK\") */ _key FROM 
> emp").resultSize(100).check();
>     }
>     /** */
>     private static class EmployerKey {
>         /** */
>         @QuerySqlField
>         private final int id0;
>         /** */
>         @QuerySqlField
>         private final int id1;
>         /** */
>         private EmployerKey(int id0, int id1) {
>             this.id0 = id0;
>             this.id1 = id1;
>         }
>     }
> }
> {code}
> Fails with:
> {noformat}
> ...
> Caused by: java.lang.ClassCastException: 
> org.apache.ignite.internal.binary.BinaryObjectImpl cannot be cast to 
> java.lang.Comparable
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.compare(ExpressionFactoryImpl.java:248)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl.access$300(ExpressionFactoryImpl.java:86)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl$1.compare(ExpressionFactoryImpl.java:182)
>       at java.util.Map$Entry.lambda$comparingByKey$6d558cbf$1(Map.java:508)
>       at java.util.PriorityQueue.siftUpUsingComparator(PriorityQueue.java:669)
>       at java.util.PriorityQueue.siftUp(PriorityQueue.java:645)
>       at java.util.PriorityQueue.offer(PriorityQueue.java:344)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.pushOrdered(Inbox.java:239)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.push(Inbox.java:201)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.Inbox.onBatchReceived(Inbox.java:177)
> ...
> {noformat}



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

Reply via email to