hadoop-hdfs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sauyuktha shetty <shettysauyukt...@gmail.com>
Subject Fwd: Doubt in DoubleWritable
Date Mon, 23 Nov 2015 07:35:01 GMT
Hi,

I am new to mapreduce. This is my first map reduce project and may look
naive. Please guide me regarding this issue I am facing.

I was trying to execute a MapReduce code that involved calculating average
values.

I found that Hadoop does not have a DoubleArrayWritabloe type and hence
extended ArrayWritable to create DoubleArrayWritable type. When I try to do
a get on it though it returns an object of type Writable rather than
DoubleWritable, which I am unable to typecast.

Below is the snippet of my code and error message.

ubuntu@ip-172-31-6-72:~/extended/data$ javac -classpath
"/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//etc/hadoop:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/common/lib/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/common/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/hdfs:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/hdfs/lib/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/hdfs/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/yarn/lib/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/yarn/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/mapreduce/lib/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//share/hadoop/mapreduce/*:/home/ubuntu/extended/hadoop-2.4.0-64bit/hadoop-common/hadoop-dist/target/hadoop-2.4.0//contrib/capacity-scheduler/*.jar;."
MapReduce.java  NewMapper.java DoubleArrayWritable.java NewReducer.java -d
output
NewMapper.java:15: error: method does not override or implement a method
from a supertype
  @Override
  ^
NewReducer.java:34: error: incomparable types: Writable and int
      if (value[1]!=0)
                  ^
NewReducer.java:37: error: bad operand types for binary operator '+'
          sumvalueTemp = sumvalueTemp + value[0];
                                      ^
  first type:  double
  second type: Writable
NewReducer.java:39: error: incomparable types: Writable and int
      if (value[3]!=0)
                  ^
NewReducer.java:42: error: bad operand types for binary operator '+'
          sumvalueDewpoint = sumvalueDewpoint + value[2];
                                              ^
  first type:  double
  second type: Writable
NewReducer.java:44: error: incomparable types: Writable and int
      if (value[5]!=0)
                  ^
NewReducer.java:47: error: bad operand types for binary operator '+'
          sumvalueWindspeed = sumvalueWindspeed + value[4];
                                                ^
  first type:  double
  second type: Writable
7 errors

Regards,
Sauyuktha

Mime
View raw message