Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
For example:
create table t(d date) create index my_index on t(d); insert into t values (date '2021-01-01') insert into t values (date '2021-01-02') select * from t where d = date '2021-01-01'
Fails with:
Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to wrap object into H2 Value. java.lang.Integer cannot be cast to java.sql.Date at org.apache.ignite.internal.processors.query.h2.index.keys.H2ValueWrapperMixin.wrapToValue(H2ValueWrapperMixin.java:37) at org.apache.ignite.internal.processors.query.h2.index.keys.DateIndexKey.<init>(DateIndexKey.java:31) at org.apache.ignite.internal.cache.query.index.sorted.keys.IndexKeyFactory.wrap(IndexKeyFactory.java:95) at org.apache.ignite.internal.processors.query.calcite.exec.IndexScan.row2indexRow(IndexScan.java:173) at org.apache.ignite.internal.processors.query.calcite.exec.IndexScan.row2indexRow(IndexScan.java:58) at org.apache.ignite.internal.processors.query.calcite.exec.AbstractIndexScan.iterator(AbstractIndexScan.java:84) at org.apache.ignite.internal.processors.query.calcite.exec.IndexScan.iterator(IndexScan.java:145)
We should convert DATE/TIME/TIMESTAMP from internal presentation (see TypeUtils.fromInternal()) before creating IndexRow.
Attachments
Issue Links
- blocks
-
IGNITE-15436 Calcite engine. Merge Calcite SQL Engine to Ignite 2.x
- Resolved
- is part of
-
IGNITE-12248 Apache Calcite based query execution engine
- Open
- is required by
-
IGNITE-16639 Sql. Index on DATE/TIME/TIMESTAMP fields cannot be used.
- Open
- links to