1 Reply Latest reply on Oct 20, 2016 1:26 PM by shawkins

    JDBC translator treat MariaDB int/integer data type to long in importing the Metadata

    kylin

      Create table in MariaDB like

      CREATE TABLE TEST_TABLE(time integer);
      

      but the teiid treat integer to long in loading the metadata and a exception thew in vdb deploying

      org.teiid.deployers.VirtualDatabaseException: TEIID40095 TEIID31080 TEST.TESTVIEW validation error: The definition for TEST.TESTVIEW has the wrong type for column 1.  Expected integer, but was long.
          at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:761)
          at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:700)
      

      Should this be a expected behavior? or it should be a defects?

        • 1. Re: JDBC translator treat MariaDB int/integer data type to long in importing the Metadata
          shawkins

          > but the teiid treat integer to long in loading the metadata

           

          This is likely due to the MariaDB integer being unsigned by default and the importer defaults to widening unsigned types - as a general rule the imported types are as wide or wider than the source types.

           

          > a exception thew in vdb deploying

           

          If you have a view that is expecting an integer and instead the expression is a long, then yes that should be an exception.

           

          > Should this be a expected behavior? or it should be a defects?

           

          You should either use a signed MariaDB integer, or set the importer to not widen unsigned types.