ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Paschenko (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-4340) Implicitly cast new column values to expected types on SQL UPDATE
Date Wed, 30 Nov 2016 13:26:58 GMT
Alexander Paschenko created IGNITE-4340:
-------------------------------------------

             Summary: Implicitly cast new column values to expected types on SQL UPDATE
                 Key: IGNITE-4340
                 URL: https://issues.apache.org/jira/browse/IGNITE-4340
             Project: Ignite
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 1.8
            Reporter: Alexander Paschenko
            Assignee: Alexander Paschenko
             Fix For: 1.8


When the following query is run,

{code:sql}
update AllTypes set longCol = 1 where _key = ?
{code}

it fails with exception

{noformat}
Suppressed: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long
			at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$RowDescriptor.wrap(IgniteH2Indexing.java:2960)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2AbstractKeyValueRow.getValue(GridH2AbstractKeyValueRow.java:316)
			at org.h2.index.BaseIndex.compareRows(BaseIndex.java:294)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.compare(GridH2TreeIndex.java:103)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.compare(GridH2TreeIndex.java:95)
			at java.util.concurrent.ConcurrentSkipListMap$ComparableUsingComparator.compareTo(ConcurrentSkipListMap.java:647)
			at java.util.concurrent.ConcurrentSkipListMap.findPredecessor(ConcurrentSkipListMap.java:727)
			at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:850)
			at java.util.concurrent.ConcurrentSkipListMap.put(ConcurrentSkipListMap.java:1645)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex.put(GridH2TreeIndex.java:362)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.doUpdate(GridH2Table.java:566)
			at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.update(GridH2Table.java:495)
			at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.store(IgniteH2Indexing.java:603)
			at org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:737)
			at org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:431)
			at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.updateIndex(GridCacheMapEntry.java:4019)
			at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:2458)
			at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2385)
			at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1787)
{noformat}

It's due to that UPDATE's SELECT part selects 1 as int, and that's what we're setting to field.
Problem can be solved by casting SELECTed values to the types that columns expect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message