[JBoss JIRA] (TEIID-5816) DDLStringVisitor should exclude dangling foreign keys
by Steven Hawkins (Jira)
Steven Hawkins created TEIID-5816:
-------------------------------------
Summary: DDLStringVisitor should exclude dangling foreign keys
Key: TEIID-5816
URL: https://issues.jboss.org/browse/TEIID-5816
Project: Teiid
Issue Type: Task
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
For resolved metadata we should omit foreign keys that reference tables that are filtered out.
For example with
CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 varchar, PRIMARY KEY(g1e1, g1e2));
CREATE FOREIGN TABLE G2( g2e1 integer, g2e2 varchar, PRIMARY KEY(g2e1, g2e2), FOREIGN KEY (g2e1, g2e2) REFERENCES G1));
and a filter to only include G2, we should omit the foreign key so that the returned ddl is valid.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Steven Hawkins commented on TEIIDSB-118:
----------------------------------------
> So, may be default value is 19 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
The effective default in terms of string length is 29.
> And, its so strange behavior if precision is string representation length...for odata4
That is not intended and will be corrected with this issue.
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Renat Eskenin commented on TEIIDSB-118:
---------------------------------------
And, its so strange behavior if precision is string representation length...for odata4. Because odata mean precision as length of fractional seconds...may be, its need to check. So default for odata need to 6 or 9. Its just my think :) need to research this.
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Renat Eskenin edited comment on TEIIDSB-118 at 9/20/19 1:10 PM:
----------------------------------------------------------------
1, 2. Ok, string representation length. I did not check jdbc spec, tnx :) But in ddl generation/parsing (step 2) we have wrong ddl generated by jdbc metadata, because we have zero precision, not just default (buggy 4 value).
3. So, may be default value is 19 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
was (Author: i3draven):
1, 2. Ok, string representation length. I did not check jdbc spec, tnx :) But in ddl generation/parsing (step 2) we have wrong ddl generated by jdbc metadata, because we have zero precision, not just default (buggy 4 value).
3. So, may be default value is 19 or 20 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Renat Eskenin edited comment on TEIIDSB-118 at 9/20/19 1:06 PM:
----------------------------------------------------------------
1, 2. Ok, string representation length. I did not check jdbc spec, tnx :) But in ddl generation/parsing (step 2) we have wrong ddl generated by jdbc metadata, because we have zero precision, not just default (buggy 4 value).
3. So, may be default value is 19 or 20 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
was (Author: i3draven):
1, 2. Ok, string representation length. I did not check it :) But in ddl generation/parsing (step 2) we have wrong ddl generated by jdbc metadata, because we have zero precision, not just default (buggy 4 value).
3. So, may be default value is 19 or 20 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Renat Eskenin commented on TEIIDSB-118:
---------------------------------------
1, 2. Ok, string representation length. I did not check it :) But in ddl generation/parsing (step 2) we have wrong ddl generated by jdbc metadata, because we have zero precision, not just default (buggy 4 value).
3. So, may be default value is 19 or 20 https://docs.oracle.com/javase/8/docs/api/java/sql/Timestamp.html
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Steven Hawkins (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Steven Hawkins commented on TEIIDSB-118:
----------------------------------------
It can be captured in another issue to associate a precision with a timestamp defined in ddl.
> 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Steven Hawkins (Jira)
[ 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)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ https://issues.jboss.org/browse/TEIIDSB-118?page=com.atlassian.jira.plugi... ]
Renat Eskenin updated TEIIDSB-118:
----------------------------------
Description:
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
was:
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
> 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.5#713005)
4 years, 8 months
[JBoss JIRA] (TEIIDSB-118) zero precision loaded for java.sql.Timestamp
by Renat Eskenin (Jira)
[ 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)
4 years, 8 months