-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-12966][SQL] Support ArrayType(DecimalType) in Postgre JDBC #10898
Conversation
Test build #49989 has finished for PR 10898 at commit
|
retest this please |
You should not be converting to doubles when testing BigDecimal or DecimalType.. |
Also, we should be handling the precision and scale returned from Postgres. I've looked deep enough to see that this is possible. |
ISTM precision and scale returned by postgres are filled with |
val c13Expected = Seq(1.5, 3.25).map(new java.math.BigDecimal(_)) | ||
assert(rows(0).getSeq[java.math.BigDecimal](13).zipWithIndex.forall { case (v, idx) => | ||
v.compareTo(c13Expected(idx)) == 0 | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not follow the style of the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like
assert(rows(0).getSeq(13) == Seq[BigDecimal](0.11, 0.22))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test fails because the behaviour of BigDecimal#equals
and BigDecimal#compareTo
are different.
Test build #49993 has finished for PR 10898 at commit
|
@maropu Indeed, but they are not available in the metadata pased to |
Jenkins, retest this please. |
Test build #49995 has finished for PR 10898 at commit
|
Test build #49998 has finished for PR 10898 at commit
|
I found that it's not easy to support this type in postgresql in the current interface of I'm not sure how to fix this though, it seems okay to just add TODO comments and throw an unsupported exception for this type for the time being. |
Test build #50251 has finished for PR 10898 at commit
|
@maropu I see a corner case in |
I'll close this pr and I discuss this in #10928. |
The current master throws an exception below;
This pr fixes this issue.