[ 
https://issues.apache.org/jira/browse/IGNITE-4333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexander Paschenko resolved IGNITE-4333.
-----------------------------------------
    Resolution: Duplicate
      Assignee: Alexander Paschenko

Apparently duplicates IGNITE-4340 - SELECTed arrays are component type erased, 
and that's why the problem occurred. Fixed via checking given array's component 
type in UPDATE/INSERT/MERGE and converting from {{Object[]}} to desired (non 
primitive) array type using metadata from {{QueryEntity}}.

> SQL engine does not preserve metadata about array content's type
> ----------------------------------------------------------------
>
>                 Key: IGNITE-4333
>                 URL: https://issues.apache.org/jira/browse/IGNITE-4333
>             Project: Ignite
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 1.8
>            Reporter: Alexander Paschenko
>            Assignee: Alexander Paschenko
>             Fix For: 2.0
>
>
> This problem arises on SQL *SELECT* from grid table and on results page 
> transfer over network.
> First, when data is *SELECT* ed, 
> {{org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.RowDescriptor#wrap}}
>  does not look at array's component type and tries to convert any array to 
> {{Object[]}} which turns to {{ClassCastException}} when array is of primitive 
> type and erases metadata about its contents when its type is not primitive.
> Then, when results page is transferred over network, array is wrapped into 
> {{org.apache.ignite.internal.processors.query.h2.twostep.msg.GridH2Array}} 
> which does not have any metadata too, so, even if we had returned primitive 
> array from native H2's local *SELECT*, information about its primitiveness 
> would be lost anyway, and it would be converted to, say, {{java.lang.Byte[]}} 
> after all.
> So, currently there's no way to *SELECT* a primitive array field via SQL.
> Probably this could be fixed by changing {{GridH2Array}}, but this would 
> break backward compatibility, so it's an open question for now.



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

Reply via email to