You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/12/05 12:38:58 UTC

[jira] [Commented] (IGNITE-4340) Implicitly cast new column values to expected types on SQL UPDATE

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

ASF GitHub Bot commented on IGNITE-4340:
----------------------------------------

Github user asfgit closed the pull request at:

    https://github.com/apache/ignite/pull/1303


> 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: Vladimir Ozerov
>             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)