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

added decimal type #54

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ExpandingMan
Copy link
Collaborator

This fixes #53 by adding support for decimal types via Decimals.jl.

@codecov-io
Copy link

codecov-io commented Nov 21, 2019

Codecov Report

Merging #54 into master will increase coverage by 0.29%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
+ Coverage   69.07%   69.37%   +0.29%     
==========================================
  Files           3        3              
  Lines         152      160       +8     
==========================================
+ Hits          105      111       +6     
- Misses         47       49       +2
Impacted Files Coverage Δ
src/tables.jl 74.28% <ø> (ø) ⬆️
src/JDBC.jl 70.51% <75%> (+0.51%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 28b079b...6cb2d92. Read the comment docs.

Project.toml Outdated Show resolved Hide resolved
@@ -548,7 +571,7 @@ global const get_method_dict = Dict(
# JDBC_COLTYPE_CLOB => 2005,
# JDBC_COLTYPE_DATALINK => 70,
JDBC_COLTYPE_DATE => getDate,
JDBC_COLTYPE_DECIMAL => getFloat,
JDBC_COLTYPE_DECIMAL => getBigDecimal,
Copy link
Member

Choose a reason for hiding this comment

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

So one of the reasons I hadn't implemented this yet is the fear that doing things this way means every numeric field is now Decimal object, which is hundreds of time slower. Even columsn with small or low precision numbers. Should I not worry about that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was also concerned about just what the meaning was of NUMERIC. As far as I can tell, NUMERIC really does mean decimal, and not float, see here. Even if this is true, it doesn't mean there aren't lots of places where people have carelessly declared fields that should be floats as NUMERIC, but not much we can do about that I suppose.

@ExpandingMan
Copy link
Collaborator Author

Note that it might be worth considering using DecFP.jl instead of Decimals.jl, even though technically Decimals is the right package to use because it is arbitrary precision as BigDecimal claims to be. The reason is just that Decimal seems like it is probably ungodly slow. It even seemingly itroduces type instability for no reason (Decimal has Integer fields).

Another concern is that I didn't find a good way to convert between Java's BigDecimal and Julia's Decimal. Right now this is being done with strings which is just awful. I really should dig into this a bit more, it will take some experimenting with BigDecimal. You might not want to merge this unless there is some better solution for converting the types.

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.

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