Description
Steps to reproduce:
sql-cli> create table tt(id INTEGER not null, field_1 TINYINT, field_2 SMALLINT, primary key (id)); Updated 0 rows. sql-cli> SELECT * FROM tt WHERE field_2 = 50; ╔════╤═════════╤═════════╗ ║ ID │ FIELD_1 │ FIELD_2 ║ ╠════╧═════════╧═════════╣ ║ (empty) ║ ╚════════════════════════╝ -- select over field_2 works fine until we create an index on it! sql-cli> CREATE INDEX tt_idx ON tt (field_2); Updated 0 rows. sql-cli> SELECT * FROM tt WHERE field_2 = 50; SQL query execution error Exception while executing query [query=SELECT * FROM tt WHERE field_2 = 50;]. Error message:Query remote fragment execution failed: nodeName=defaultNode, queryId=15a68600-41bc-46c5-b20d-7a96aad15477, fragmentId=4, originalMessage=class java.lang.Integer cannot be cast to class java.lang.Short (java.lang.Integer and java.lang.Short are in module java.base of loader 'bootstrap')
This doesn't look good. A created index must not cause casting exception.
Reproduced on commit `fef7a24c2a029cac720d2fea3815c2a70a86b72f` (2023-07-12)
Attachments
Issue Links
- is caused by
-
IGNITE-19615 Index is not used while performing SELECT over an indexed column
- Resolved
- is related to
-
IGNITE-21662 Sql: Data may be unavailable after creation of index
- Resolved
-
IGNITE-19997 Sql. Enhancing test coverage of type coercion
- Open
- links to