You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Nikolay Izhikov (Jira)" <ji...@apache.org> on 2020/10/05 07:21:00 UTC

[jira] [Commented] (IGNITE-13200) SQL create index on invalid data type

    [ https://issues.apache.org/jira/browse/IGNITE-13200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17207867#comment-17207867 ] 

Nikolay Izhikov commented on IGNITE-13200:
------------------------------------------

Hello, [~tledkov-gridgain], [~alex_pl]

Looks like we miss this fix in the 2.9 branch.
Can you, please, confirm it?
It a blocker for one of the Ignite users.
We should include this fix in 2.9

> SQL create index on invalid data type
> -------------------------------------
>
>                 Key: IGNITE-13200
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13200
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>    Affects Versions: 2.8.1
>            Reporter: Taras Ledkov
>            Assignee: Taras Ledkov
>            Priority: Major
>             Fix For: 2.9
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> *Reproduce*
> - Create cache with value class
> {code}
>     private static class Value {
>         @QuerySqlField
>         int val_int;
>         java.util.Date val_date;
>     }
> {code}
> - alter table with command
> {{ALTER TABLE TEST ADD COLUMN (VAL_DATE DATE)}}
> - try to create index with command
> {{CREATE INDEX TEST_VAL_DATE_IDX ON TEST(VAL_DATE)}}
> {{CorruptedTreeException}} is thrown, the node is stopped.
> {code}
> class org.apache.ignite.IgniteCheckedException: Runtime failure on row: Row@6a2853cd[ key: 0, val: org.apache.ignite.internal.processors.query.CreateIndexOnInvalidDataTypeTest$Value [idHash=1693430008, hash=1583713321, val_int=0, val_date=Thu Jan 01 03:00:00 MSK 1970] ][ 0, <value skipped on error: Failed to wrap object into H2 Value. java.util.Date cannot be cast to java.sql.Date> ]
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.doPut(BPlusTree.java:2438)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.putx(BPlusTree.java:2388)
> 	at org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex.putx(H2TreeIndex.java:434)
> 	at org.apache.ignite.internal.processors.query.h2.IndexBuildClosure.apply(IndexBuildClosure.java:52)
> 	at org.apache.ignite.internal.processors.query.schema.SchemaIndexCachePartitionWorker$SchemaIndexCacheVisitorClosureWrapper.apply(SchemaIndexCachePartitionWorker.java:298)
> 	at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.updateIndex(GridCacheMapEntry.java:4494)
> 	at org.apache.ignite.internal.processors.query.schema.SchemaIndexCachePartitionWorker.processKey(SchemaIndexCachePartitionWorker.java:231)
> 	at org.apache.ignite.internal.processors.query.schema.SchemaIndexCachePartitionWorker.processPartition(SchemaIndexCachePartitionWorker.java:188)
> 	at org.apache.ignite.internal.processors.query.schema.SchemaIndexCachePartitionWorker.body(SchemaIndexCachePartitionWorker.java:127)
> 	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> 	at java.lang.Thread.run(Thread.java:748)
> Caused by: class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to wrap object into H2 Value. java.util.Date cannot be cast to java.sql.Date
> 	at org.apache.ignite.internal.processors.query.h2.opt.H2CacheRow.wrap(H2CacheRow.java:177)
> 	at org.apache.ignite.internal.processors.query.h2.opt.H2CacheRow.getValue0(H2CacheRow.java:109)
> 	at org.apache.ignite.internal.processors.query.h2.opt.H2CacheRow.getValue(H2CacheRow.java:91)
> 	at org.apache.ignite.internal.processors.query.h2.database.io.AbstractH2ExtrasLeafIO.storeByOffset(AbstractH2ExtrasLeafIO.java:115)
> 	at org.apache.ignite.internal.processors.query.h2.database.io.AbstractH2ExtrasLeafIO.storeByOffset(AbstractH2ExtrasLeafIO.java:37)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO.store(BPlusIO.java:185)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.io.BPlusIO.insert(BPlusIO.java:272)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.insertSimple(BPlusTree.java:3685)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.insert(BPlusTree.java:3667)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.access$1900(BPlusTree.java:3539)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Insert.run0(BPlusTree.java:452)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Insert.run0(BPlusTree.java:433)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$GetPageHandler.run(BPlusTree.java:5889)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$GetPageHandler.run(BPlusTree.java:5875)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.util.PageHandler.writePage(PageHandler.java:360)
> 	at org.apache.ignite.internal.processors.cache.persistence.DataStructure.write(DataStructure.java:297)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.access$11300(BPlusTree.java:99)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.tryInsert(BPlusTree.java:3859)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree$Put.access$7100(BPlusTree.java:3539)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.putDown(BPlusTree.java:2803)
> 	at org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.doPut(BPlusTree.java:2408)
> 	... 12 more
> Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date
> 	at org.apache.ignite.internal.processors.query.h2.H2Utils.wrap(H2Utils.java:625)
> 	at org.apache.ignite.internal.processors.query.h2.opt.H2CacheRow.wrap(H2CacheRow.java:174)
> 	... 32 more
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)