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

JDBC.coltypes chooses the wrong type for NUMBER(10,0) columns on Oracle 11g database #53

Open
metanoid opened this issue Nov 21, 2019 · 1 comment · May be fixed by #54
Open

JDBC.coltypes chooses the wrong type for NUMBER(10,0) columns on Oracle 11g database #53

metanoid opened this issue Nov 21, 2019 · 1 comment · May be fixed by #54

Comments

@metanoid
Copy link

I have an Oracle 11g database, where EVENT ID's (integers) have been stored as the Oracle data type NUMBER(10,0). This indicates 10 digits of precision, at a scale of 0 (i.e. 10^0). The scale value being non-negative means that this value will always be integer, but when I look at the result of JDBC.coltypes(JDBC.Source(csr)) the column has been assigned the DataType of Float64.
This is also happening if I look at Tables.schema(JDBC.Source(csr)).

It's possible to convert these columns to Int, but I worry that if I had very large precision integers, and JDBC.jl treated them as Float64, then I might lose precision, which on ID's is a major problem.

@ExpandingMan
Copy link
Collaborator

Looks like we have decimals being converted to floats, probably because nobody ever got around to implementing decimals. This is definitely a really bad and dangerous behavior. It seems a little odd that JDBC allows you to call getFloat here without warning or error, which is what is happening.

I'm not sure what Java would return here, probably this. I'll try to look into this, however it'll be difficult for me to set up a test for it, so if anyone else can aid with this it would be appreciated.

@ExpandingMan ExpandingMan linked a pull request Nov 21, 2019 that will close this issue
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 a pull request may close this issue.

2 participants