1 Reply Latest reply on Nov 30, 2012 2:43 PM by shawkins

    Teiid Primitive Arrays using columns defined as Object

    sroberts

      I am writing a custom Teiid translator for an internal database API. In our data model we have primitive arrays. I am trying to pass these arrays through Teiid untransformed by using the TypeFacility.RUNTIME_NAMES.OBJECT definition. The strategy is working for most types. Float[], int[], long[], double[] and String[] all work flawlessly. I pass the array through on my translator, and the client casts the array to the proper type.

       

      The strategy is not working for char[] and byte[]. Teiid is transforming or wrapping these arrays in unexpected ways. Inputs defined as Objects and expecting byte[] become org.teiid.core.types.BinaryType, and char[] to org.teiid.core.types.ClobImpl.

       

      Is there a better way to use primitive arrays on Teiid? Is there a way to strongly type primitive arrays and prevent the use of BinaryType and ClobImpl?

       

      Thanks,

      Stanley

        • 1. Re: Teiid Primitive Arrays using columns defined as Object
          shawkins

          >Is there a better way to use primitive arrays on Teiid? Is there a way to strongly type primitive arrays and prevent the use of BinaryType and ClobImpl?

           

          Teiid currently automatically does consider char[] and byte[] to binary/clob representations as there are many cases where drivers return these values.  That conversion is taking place however without consulting the target type.  It would probably be better to delay this conversion for char[]/byte[] instances until an explicit cast is performed.  Can you log an issue for this?

           

          Steve