[ 
https://issues.apache.org/jira/browse/SQOOP-1125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13702322#comment-13702322
 ] 

Kyrill Alyoshin commented on SQOOP-1125:
----------------------------------------

Basically, you likely want to always ROUND_UP in

protected BigDecimal tryDivide(BigDecimal numerator, BigDecimal denominator) {
    try {
      return numerator.divide(denominator);
    } catch (ArithmeticException ae) {
      return numerator.divide(denominator, BigDecimal.ROUND_HALF_UP);
    }
  }

instead of ROUND_HALF_UP which gives a zero when getting a result of any 
division less that 0.5.
                
> Out of memory errors when number of records to import < 0.5 * splitSize
> -----------------------------------------------------------------------
>
>                 Key: SQOOP-1125
>                 URL: https://issues.apache.org/jira/browse/SQOOP-1125
>             Project: Sqoop
>          Issue Type: Bug
>    Affects Versions: 1.4.3
>            Reporter: Dave Kincaid
>            Priority: Critical
>
> We are getting out of memory errors during import if the number of records to 
> import is less than 0.5*splitSize (and is nonterminating decimal).
> For example, if the numSplits = 3, minVal = 100, maxVal = 101 then in 
> BigDecimalSplitter.split() an extraordinary number of tiny values will be 
> added to the splits List and run out of memory eventually.
> I also noticed that there are no tests for BigDecimalSplitter.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to