[
https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi...
]
Renat Eskenin updated TEIIDSB-118:
----------------------------------
Steps to Reproduce:
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.
was:
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 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.
zero precision loaded for java.sql.Timestamp
--------------------------------------------
Key: TEIIDSB-118
URL:
https://issues.jboss.org/browse/TEIIDSB-118
Project: Teiid Spring Boot
Issue Type: Bug
Components: datasource, OData
Affects Versions: 1.2.0
Reporter: Renat Eskenin
Priority: Major
Attachments: image-2019-09-20-13-30-58-536.png,
image-2019-09-20-13-34-56-255.png
I create spring-boot project for translate jdbc connection from vertica JDBC to odata4
REST interface.
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
!image-2019-09-20-13-34-56-255.png|thumbnail!
name: created_by_id
type: Timestamp
column size: 26
decimal digits: 6
--
This message was sent by Atlassian Jira
(v7.13.5#713005)