GitHub user viirya opened a pull request:

    https://github.com/apache/spark/pull/8963

    [SPARK-10909][SQL] Fix precision overflow problem for Oracle NUMBER column

    JIRA: https://issues.apache.org/jira/browse/SPARK-10909
    
    When connecting with Oracle DB through JDBC, the precision and scale of 
BigDecimal object returned by ResultSet.getBigDecimal may not be correctly 
matched to the precision and the scale of the reported schema. It may cause a 
problem like: a BigDecimal object representing 19999 with precision 5 and scale 
0 for a column with schema of precision 5 and scale 2. If we use the reported 
precision and scale and create Decimal object later, Decimal class will raise 
"Overflowed precision" error because actually we create a Decimal(7, 2) for 
19999.99. To solve that, this patch adds scale to the precision here.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/viirya/spark-1 fix-oracle-jdbc-number-overflow

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/8963.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #8963
    
----
commit a79836019316bab3090973aae9c3fdb76c6ae76f
Author: Liang-Chi Hsieh <[email protected]>
Date:   2015-10-02T14:58:54Z

    Fix precision overflow problem for Oracle NUMBER column.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to