Konstantin Orlov created IGNITE-27718:
-----------------------------------------

             Summary: Sql. ClassCastException when table level hint is used in 
UPDATE
                 Key: IGNITE-27718
                 URL: https://issues.apache.org/jira/browse/IGNITE-27718
             Project: Ignite
          Issue Type: Bug
          Components: sql ai3
    Affects Versions: 3.1
            Reporter: Konstantin Orlov


If table-level hint is specified in UPDATE statement like this:
{code}
UPDATE my_table /*+ force_index(my_table_idx) */ SET val = ?
{code}

then cClassCastException is thrown:
{code}
Caused by: java.lang.ClassCastException: class 
org.apache.calcite.sql.SqlTableRef cannot be cast to class 
org.apache.calcite.sql.SqlIdentifier (org.apache.calcite.sql.SqlTableRef and 
org.apache.calcite.sql.SqlIdentifier are in unnamed module of loader 'app')
        at 
org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.createSourceSelectForUpdate(IgniteSqlValidator.java:583)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.performUnconditionalRewrites(SqlValidatorImpl.java:1600)
        at 
org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.performUnconditionalRewrites(IgniteSqlValidator.java:1031)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:1108)
        at 
org.apache.calcite.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:821)
        at 
org.apache.ignite.internal.sql.engine.prepare.IgniteSqlValidator.validate(IgniteSqlValidator.java:192)
        at 
org.apache.ignite.internal.sql.engine.prepare.IgnitePlanner.validate(IgnitePlanner.java:202)
        at 
org.apache.ignite.internal.sql.engine.prepare.PrepareServiceImpl.lambda$validateDml$30(PrepareServiceImpl.java:897)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run$$$capture(CompletableFuture.java:1768)
        ... 22 more
{code}



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

Reply via email to