Java Error with Assignment 3



0
Hi,

I am trying to assignment 3 from module 3 and I am running into the following error. I am not for a java background. Can you please help?



15/05/04 20:37:53 INFO mapred.JobClient: Task Id : attempt_201505040942_0004_m_000000_0, Status : FAILED
java.lang.NumberFormatException: For input string: "701057841400.00"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:419)
at java.lang.Long.parseLong(Long.java:468)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:33)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:1)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)

15/05/04 20:38:00 INFO mapred.JobClient: Task Id : attempt_201505040942_0004_m_000000_1, Status : FAILED
java.lang.NumberFormatException: For input string: "701057841400.00"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:419)
at java.lang.Long.parseLong(Long.java:468)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:33)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:1)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)

15/05/04 20:38:07 INFO mapred.JobClient: Task Id : attempt_201505040942_0004_m_000000_2, Status : FAILED
java.lang.NumberFormatException: For input string: "701057841400.00"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:419)
at java.lang.Long.parseLong(Long.java:468)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:33)
at com.assignments.NasdaqAssignment1$Map.map(NasdaqAssignment1.java:1)
at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:50)
at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:417)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)
at org.apache.hadoop.mapred.Child$4.run(Child.java:268)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)
at org.apache.hadoop.mapred.Child.main(Child.java:262)

15/05/04 20:38:19 INFO mapred.JobClient: Job complete: job_201505040942_0004
15/05/04 20:38:19 INFO mapred.JobClient: Counters: 29
15/05/04 20:38:19 INFO mapred.JobClient: File System Counters
15/05/04 20:38:19 INFO mapred.JobClient: FILE: Number of bytes read=2050541
15/05/04 20:38:19 INFO mapred.JobClient: FILE: Number of bytes written=4261776
15/05/04 20:38:19 INFO mapred.JobClient: FILE: Number of read operations=0
15/05/04 20:38:19 INFO mapred.JobClient: FILE: Number of large read operations=0
15/05/04 20:38:19 INFO mapred.JobClient: FILE: Number of write operations=0
15/05/04 20:38:19 INFO mapred.JobClient: HDFS: Number of bytes read=24903806
15/05/04 20:38:19 INFO mapred.JobClient: HDFS: Number of bytes written=0
15/05/04 20:38:19 INFO mapred.JobClient: HDFS: Number of read operations=2
15/05/04 20:38:19 INFO mapred.JobClient: HDFS: Number of large read operations=0
15/05/04 20:38:19 INFO mapred.JobClient: HDFS: Number of write operations=0
15/05/04 20:38:19 INFO mapred.JobClient: Job Counters
15/05/04 20:38:19 INFO mapred.JobClient: Failed map tasks=1
15/05/04 20:38:19 INFO mapred.JobClient: Launched map tasks=5
15/05/04 20:38:19 INFO mapred.JobClient: Data-local map tasks=5
15/05/04 20:38:19 INFO mapred.JobClient: Total time spent by all maps in occupied slots (ms)=49091
15/05/04 20:38:19 INFO mapred.JobClient: Total time spent by all reduces in occupied slots (ms)=0
15/05/04 20:38:19 INFO mapred.JobClient: Total time spent by all maps waiting after reserving slots (ms)=0
15/05/04 20:38:19 INFO mapred.JobClient: Total time spent by all reduces waiting after reserving slots (ms)=0
15/05/04 20:38:19 INFO mapred.JobClient: Map-Reduce Framework
15/05/04 20:38:19 INFO mapred.JobClient: Map input records=457310
15/05/04 20:38:19 INFO mapred.JobClient: Map output records=457309
15/05/04 20:38:19 INFO mapred.JobClient: Map output bytes=5948601
15/05/04 20:38:19 INFO mapred.JobClient: Input split bytes=126
15/05/04 20:38:19 INFO mapred.JobClient: Combine input records=0
15/05/04 20:38:19 INFO mapred.JobClient: Combine output records=0
15/05/04 20:38:19 INFO mapred.JobClient: Spilled Records=914618
15/05/04 20:38:19 INFO mapred.JobClient: CPU time spent (ms)=2480
15/05/04 20:38:19 INFO mapred.JobClient: Physical memory (bytes) snapshot=156573696
15/05/04 20:38:19 INFO mapred.JobClient: Virtual memory (bytes) snapshot=664854528
15/05/04 20:38:19 INFO mapred.JobClient: Total committed heap usage (bytes)=110563328
15/05/04 20:38:19 INFO mapred.JobClient: org.apache.hadoop.mapreduce.lib.input.FileInputFormatCounter
15/05/04 20:38:19 INFO mapred.JobClient: BYTES_READ=24865746
15/05/04 20:38:19 INFO mapred.JobClient: Job Failed: NA
Exception in thread "main" java.io.IOException: Job failed!
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1372)
at com.assignments.NasdaqAssignment1.main(NasdaqAssignment1.java:65)
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)

Thanks

3 Answer(s)


0

Token [7] which you are trying to parse to long is looking like double. And also there is no such value, as you might have noticed. Can you check the contents of the file are not corrupt , also using the correct data file? Or try with couple of records and see whether it works

0

Hi, i think you are trying to read double value into long. It should work if you make the necessary changes as pointed out by Aneesh.

0

hi Srinivasa,

Please let us know the program name and the command that you are executing and the sample input. All programs from LMS should work without any errors.

Thanks

Your Answer

Click on this code-snippet-icon icon to add code snippet.

Upload Files (Maximum image file size - 1.5 MB, other file size - 10 MB, total size - not more than 50 MB)

Email
Password