You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Igor (Jira)" <ji...@apache.org> on 2023/05/11 12:03:00 UTC

[jira] [Created] (IGNITE-19456) Drop one column of composite index makes impossible queries to other columns in the index

Igor created IGNITE-19456:
-----------------------------

             Summary: Drop one column of composite index makes impossible queries to other columns in the index
                 Key: IGNITE-19456
                 URL: https://issues.apache.org/jira/browse/IGNITE-19456
             Project: Ignite
          Issue Type: Bug
          Components: jdbc, sql, thin client
            Reporter: Igor


h1. Steps to reproduce:

1. Create table.
{code:java}
CREATE TABLE index_test_table_5(id INT PRIMARY KEY, field_1 TINYINT, field_2 SMALLINT, field_3 INT, field_4 FLOAT, field_5 VARCHAR){code}
2. Create composite index:
{code:java}
CREATE INDEX index_test_index_5_1 ON index_test_table_5(field_2, field_3, field_5){code}
3. Insert some rows.

4. Drop one column of composite index:
{code:java}
ALTER TABLE " + tableName + " DROP COLUMN field_5{code}
5. Execute select filtering 2 other columns
{code:java}
SELECT * FROM index_test_table_5 WHERE field_2 = 50 AND field_3 = 50{code}
h1. Expected result:

The filtered row is retrned.
h1. Actual result:

An exception:

 
{code:java}
Exception while executing query [query=SELECT * FROM index_test_table_5 WHERE field_2 = 50 AND field_3 = 50]. Error message:Error while applying rule ExposeIndexRule, args [rel#9120:IgniteLogicalTableScan.NONE.[].any(table=[PUBLIC, INDEX_TEST_TABLE_5],filters=AND(=(CAST($t2):INTEGER, 50), =($t3, 50)),requiredColumns={0, 1, 2, 3, 4})]
java.sql.SQLException: Exception while executing query [query=SELECT * FROM index_test_table_5 WHERE field_2 = 50 AND field_3 = 50]. Error message:Error while applying rule ExposeIndexRule, args [rel#9120:IgniteLogicalTableScan.NONE.[].any(table=[PUBLIC, INDEX_TEST_TABLE_5],filters=AND(=(CAST($t2):INTEGER, 50), =($t3, 50)),requiredColumns={0, 1, 2, 3, 4})]
    at org.apache.ignite.internal.jdbc.proto.IgniteQueryErrorCode.createJdbcSqlException(IgniteQueryErrorCode.java:57)
    at org.apache.ignite.internal.jdbc.JdbcStatement.execute0(JdbcStatement.java:148)
    at org.apache.ignite.internal.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:108) {code}
 



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