Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEIID-5826: Adding ability to read length, precision and scale from m… #1182

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

rareddy
Copy link
Member

@rareddy rareddy commented Oct 25, 2019

…etadata properties for OData V2, and SAP transaltors

@rareddy rareddy requested a review from shawkins October 25, 2019 02:06
@shawkins
Copy link
Contributor

An issue would be that we have some inconsistency between the notion of odata precision and teiid precision - OData timestamp precision = Teiid Timestamp scale. See

} else if (runtimeType.equals(DataTypeManager.DefaultDataTypes.TIMESTAMP)) {

For the other non-numeric types precision isn't needed at all, but it should be okay to set it on them.

@rareddy
Copy link
Member Author

rareddy commented Oct 25, 2019

BTW, this is OData V2 only, do we know if that mismatch exists here also?

Build error seems to be unrelated.

@rareddy
Copy link
Member Author

rareddy commented Oct 25, 2019

so precision on date reflects the nanoseconds on DateTime.

So, if the "scale" on Datetime gets converted to "precision" on outbound, we need to set "precision" as "scale" on ingest, however I do not see similar behavior on OData V4, should be changed there too?

@shawkins
Copy link
Contributor

however I do not see similar behavior on OData V4, should be changed there too?

Yes that appears to have the same issue.

@rareddy
Copy link
Member Author

rareddy commented Oct 25, 2019

@shawkins Updated the code per your suggestions for the TIMESTAMP type.

Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue is that it's still setting the precision on a timestamp. The Teiid precision for a timestamp matches the jdbc definition - the length of the string definition. So you could leave it unset, or if the precision is 0, then set it to 19, otherwise 20+odata precision.

…etadata properties for OData V2, and SAP, OData V4 transaltors. Also for datatime precision is being read as scale on the teiid runtime type to support odata production on top
@rareddy
Copy link
Member Author

rareddy commented Oct 25, 2019

@shawkins Updated the PR to left it unset for timestamp.

Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rareddy rareddy merged commit 5a32f91 into teiid:master Oct 25, 2019
@rareddy rareddy deleted the TEIID-5826 branch October 25, 2019 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants