Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5817

zero precision loaded for java.sql.Timestamp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 13.0, 12.3.1
    • None
    • OData, Query Engine
    • None
    • Hide

      Teiid-spring-boot read metadata with several steps

      0. (SystemMetadata.java:60) Teiid read metadata of datatypes from teiid-engine-12.3.0.jar/org/teiid/metadata/types.dat
      in this step teiid read wrong default precision (in file we have wrong value) for timestamp type (readed 0). (1 bug)
      1. (JDBCMetadataProcessor.java:524) Teiid read metadata from JDBC and get precision in timestamp field as length of string with time (26) instead of get real precision (6). Real precision will write to scale (string 525) in column object. (2 bug)
      2. In next step Teiid write DDL and read this DDL in parser (QueryParser:532) in this step we get precision as 0 and buggy precision = 26 will not using at all from previous step. (3 bug)
      3. (ODataSchemaBuilder.java:556) In next step because precision for timestamp field is 0, Teeid set precision to 4 as default value (WHY! is 6 always 6 )
      4. (EdmDateTimeOffset:164) So Apache Olingo4 rise exception because precision = 4 and value of nanos is xxxxxx000 where x is non zero time value and precision<count of x.

      I temporary fix this bugs by change default precision in teiid-engine-12.3.0.jar/org/teiid/metadata/types.dat to 6 for timestamp

      But need to full fix this issue.

      Thanks.

      Show
      Teiid-spring-boot read metadata with several steps 0. (SystemMetadata.java:60) Teiid read metadata of datatypes from teiid-engine-12.3.0.jar/org/teiid/metadata/types.dat in this step teiid read wrong default precision (in file we have wrong value) for timestamp type (readed 0). (1 bug) 1. (JDBCMetadataProcessor.java:524) Teiid read metadata from JDBC and get precision in timestamp field as length of string with time (26) instead of get real precision (6). Real precision will write to scale (string 525) in column object. (2 bug) 2. In next step Teiid write DDL and read this DDL in parser (QueryParser:532) in this step we get precision as 0 and buggy precision = 26 will not using at all from previous step. (3 bug) 3. (ODataSchemaBuilder.java:556) In next step because precision for timestamp field is 0, Teeid set precision to 4 as default value (WHY! is 6 always 6 ) 4. (EdmDateTimeOffset:164) So Apache Olingo4 rise exception because precision = 4 and value of nanos is xxxxxx000 where x is non zero time value and precision<count of x. I temporary fix this bugs by change default precision in teiid-engine-12.3.0.jar/org/teiid/metadata/types.dat to 6 for timestamp But need to full fix this issue. Thanks.

      I create spring-boot project for translate jdbc connection from vertica JDBC to odata4 REST interface.

      Base project is spring-odata-example in teiid git.

      When i get request to object with field witch Timestamp type i get the exception:
      Request:
      GET /vertica-odata-facade/odata/vertica/domain?%24top=1
      Response:
      {
      "error":

      { "code": null, "message": "The value '2019-09-12 09:26:22.323764' is not valid for property 'created_date'." }

      }

      This field in vertica

      name: created_by_id
      type: Timestamp
      column size: 26
      decimal digits: 6

              rhn-engineering-shawkins Steven Hawkins
              3draven Renat Eskenin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: