Vladimir Steshin created IGNITE-26381:
-----------------------------------------

             Summary: Calcite. Incorrect cast of dynamic array-parameter to 
ARRAY field
                 Key: IGNITE-26381
                 URL: https://issues.apache.org/jira/browse/IGNITE-26381
             Project: Ignite
          Issue Type: Bug
            Reporter: Vladimir Steshin


{*}Reproducer{*}:
{code:java}
public class DataTypesTest extends AbstractBasicIntegrationTransactionalTest {
    /** */
    @Test
    public void test(){
        sql("CREATE TABLE tt(val INTEGER ARRAY) WITH " + atomicity());

        // Passes
        //sql("INSERT INTO tt values(?)", F.asList(1,2,3));

        sql("INSERT INTO tt values(?)", new int[]{1,2,3});
    }
} {code}
{*}Error{*}:
{code:java}
Caused by: java.lang.ClassCastException: class [I cannot be cast to class 
java.util.List ([I and java.util.List are in module java.base of loader 
'bootstrap')  at SC.execute(Unknown Source)   at 
org.apache.ignite.internal.processors.query.calcite.exec.exp.ExpressionFactoryImpl$ProjectImpl.apply(ExpressionFactoryImpl.java:718)
 at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ProjectNode.push(ProjectNode.java:63)
   at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.processNextBatch(ScanNode.java:168)
    at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:142)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.request(ScanNode.java:95)
      at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ProjectNode.request(ProjectNode.java:54)
        at 
org.apache.ignite.internal.processors.query.calcite.exec.rel.ModifyNode.tryEnd(ModifyNode.java:168)
 {code}
We either should not allow primitive arrays as parameters with a proper 
validation error or cast them correctly.



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

Reply via email to