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

Always map java.sql.Types.BIGINT to LongType #311

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

Conversation

ngerstle
Copy link

@ngerstle ngerstle commented Dec 9, 2016

java.sql.Types.BIGINT => LongType in all cases for Redshift.
Redshift has no unsigned BigInt, and thus BigInt maps to Long without loss of resolution.
See issue #310

java.sql.Types.BIGINT => LongType in all cases for Redshift.
Redshift has no unsigned BigInt, and thus BigInt maps to Long without loss of resolution.
@JoshRosen
Copy link
Contributor

JoshRosen commented Dec 9, 2016 via email

Errors/unusually behavior is associated with BigInts.
Specifically, a count(column) query sometimes returns doubles rather than longs, as would be expected from the count function (which only provides signed BigInts).
@ngerstle
Copy link
Author

ngerstle commented Dec 9, 2016

I'm not able to find any clear point at which a decimal would be converted to a double, meaning that issue #310 is unlikely to fixed by this, but the dead code should still be pruned.
I added a couple of rough regression tests- please flesh out as recommended..

@codecov-io
Copy link

codecov-io commented Dec 9, 2016

Current coverage is 88.55% (diff: 100%)

Merging #311 into master will not change coverage

@@             master       #311   diff @@
==========================================
  Files            15         15          
  Lines           769        769          
  Methods         614        615     +1   
  Messages          0          0          
  Branches        155        154     -1   
==========================================
  Hits            681        681          
  Misses           88         88          
  Partials          0          0          

Powered by Codecov. Last update 8adfe95...6a16c4b

@JoshRosen
Copy link
Contributor

Regarding the double issue, is there a possibility that our call to ask Redshift the schema is returning a Double but then Redshift is actually turning around and unexpectedly giving us a Decimal? Do you have any test case which reproduces the Double behavior, even if you don't know how to actually fix the bug?

@ngerstle
Copy link
Author

Unfortunately, I'm still trying to get a consistent abstract case- as mentioned in #310, I have a select count(column), count(distinct(column) from table that iterates over columns: sometimes it returns (bigint, bigint) and sometimes (double, bigint) (when debugging the schema of the dataframe returned when using the query option on sqlContext.read....

@JoshRosen JoshRosen changed the title Update RedshiftJDBCWrapper.scala Always map java.sql.Types.BIGINT to LongType Jan 5, 2017
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.

3 participants