[
https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi...
]
Steven Hawkins commented on TEIIDSB-118:
----------------------------------------
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)
Traditionally no precision was associated internally with Timestamps. If there were to be
a default, it would be the full nanosecond precision of 9. However in most places the
precision of a timestamp assumes the JDBC meaning - see below.
(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)
That is directly from the JDBC spec: "For datetime datatypes, this is the length in
characters of the String representation (assuming the maximum allowed precision of the
fractional seconds component)."
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)
Again the internal Teiid timestamp type simply assumes the full nano second precision, so
it's not expected that a precision value be captured.
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 )
I'm not sure where that default is coming from. The Teiid/sql time type does not
convey any fractional seconds and 6 or 9 would be a better default for OData yes.
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
Based upon the current odata handling that will work.
In short the odata default is not correct, and the interpretation of precision at that
point needs clarified.
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.
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
!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.8#713008)