hadoop-mapreduce-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAPREDUCE-6196) Fix BigDecimal ArithmeticException in PiEstimator
Date Tue, 16 Dec 2014 01:31:14 GMT

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

Ray Chiang commented on MAPREDUCE-6196:
---------------------------------------

FYI, for my testing

    hadoop jar <jarWithoutFix> pi 6 6

gives the exception in the description.

Doing the same command with the fixed jar gives me the result:

    Job Finished in 33.927 seconds
    Estimated value of Pi is 3.4444444444444444445


> Fix BigDecimal ArithmeticException in PiEstimator
> -------------------------------------------------
>
>                 Key: MAPREDUCE-6196
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-6196
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>    Affects Versions: 1.2.1
>            Reporter: Ray Chiang
>            Assignee: Ray Chiang
>            Priority: Minor
>              Labels: pi_example, supportability
>         Attachments: MAPREDUCE-6196.001.patch
>
>
> Certain combinations of arguments to PiEstimator cause the following exception:
> java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable
decimal result.
> 	at java.math.BigDecimal.divide(BigDecimal.java:1603)
> 	at org.apache.hadoop.examples.PiEstimator.estimate(PiEstimator.java:313)
> 	at org.apache.hadoop.examples.PiEstimator.run(PiEstimator.java:342)
> 	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
> 	at org.apache.hadoop.examples.PiEstimator.main(PiEstimator.java:351)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)
> 	at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:144)
> 	at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:64)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
> The calls to the BigDecimal methods should have some large default precision to prevent
this exception.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message