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

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.8
    • 2.0
    • sql
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              al.psc Alexander Paschenko
              al.psc Alexander Paschenko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: