Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-4327 Failed to INSERT array of Bytes from SELECT
  3. IGNITE-4333

SQL engine does not preserve metadata about array content's type

Attach filesAttach ScreenshotVotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.8
    • Fix Version/s: 2.0
    • Component/s: sql
    • Labels:


      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.


        Issue Links



            • Assignee:
              al.psc Alexander Paschenko
              al.psc Alexander Paschenko


              • Created:

                Issue deployment