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

Let ResultSet.getObject() return Float.NaN in case of numeric NaN #1304

Merged
merged 2 commits into from Sep 21, 2018

Conversation

Projects
None yet
4 participants
@tseylerd
Copy link
Contributor

commented Sep 21, 2018

Postgres numeric column can store NaN value which is not convertable to BigDecimal. getBigDecimal() throws exception in this case. But when we call getObject() to retrieve the data we expect any type of object as return value. So it's convenient to return Float.NaN in this case.

Related DataGrip issue: https://youtrack.jetbrains.com/issue/DBE-5141

@codecov-io

This comment has been minimized.

Copy link

commented Sep 21, 2018

Codecov Report

Merging #1304 into master will increase coverage by 0.02%.
The diff coverage is 80%.

@@             Coverage Diff              @@
##             master    #1304      +/-   ##
============================================
+ Coverage     68.49%   68.52%   +0.02%     
- Complexity     3868     3873       +5     
============================================
  Files           178      178              
  Lines         16184    16185       +1     
  Branches       2639     2639              
============================================
+ Hits          11086    11090       +4     
+ Misses         3865     3864       -1     
+ Partials       1233     1231       -2
@vlsi

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

Well, technically speaking PostgreSQL has real (~Float), double precision (~Double) and numeric (~???).

@tseylerd , is there any strong reason you think numeric should be converted to Float.NaN rather than Double.NaN ?

@vlsi vlsi force-pushed the tseylerd:master branch from 3d25733 to 15bc93e Sep 21, 2018

@tseylerd

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2018

@vlsi No. I think it's not very important. Which one is better? I don't know. But i know that anything is better than the exception. So if you prefer double let's make it double.

@davecramer

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

@tseylerd hard to say which one is better.
I don't have a preference.

@vlsi

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

I don't have a preference.

Ok, ThreadLocalRandom.current().nextBoolean() ? Float.NaN : Double.NaN then

@davecramer

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

@vlsi

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

Let's just stick with Double.NaN for "extra precision".

@vlsi vlsi added this to the 42.2.6 milestone Sep 21, 2018

@vlsi vlsi merged commit 265f22b into pgjdbc:master Sep 21, 2018

2 checks passed

codecov/project 68.54% (+0.04%) compared to b53eedf
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@vlsi

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

@tseylerd , could you please clarify expected release date?
E.g. when next DataGrip release is planned?

@tseylerd

This comment has been minimized.

Copy link
Contributor Author

commented Sep 24, 2018

@vlsi We plan to release in November. But we can update the driver separately as soon as it comes out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.