Andrey Khitrin created IGNITE-19976:
---------------------------------------
Summary: Sql: ClassCastException when trying to select from
indexed smallint column
Key: IGNITE-19976
URL: https://issues.apache.org/jira/browse/IGNITE-19976
Project: Ignite
Issue Type: Bug
Components: sql
Affects Versions: 3.0.0-beta1
Reporter: Andrey Khitrin
Steps to reproduce:
{code:sql}
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')
{code}
This doesn't look good. A created index must not cause casting exception.
Reproduced on commit `fef7a24c2a029cac720d2fea3815c2a70a86b72f` (2023-07-12)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)