mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Bryan <>
Subject Big Longs in RecommenderJob
Date Mon, 07 Jun 2010 21:42:37 GMT
I'm trying to use some real big longs in the RecommenderJob and I ran
into the following problem:

java.lang.IllegalArgumentException: Can't encode value as signed:
	at org.apache.mahout.math.Varint.writeSignedVarLong(
	at org.apache.mahout.math.VarLongWritable.write(
	at org.apache.hadoop.mapred.MapTask$MapOutputBuffer.collect(
	at org.apache.hadoop.mapred.MapTask$NewOutputCollector.write(
	at org.apache.hadoop.mapreduce.TaskInputOutputContext.write(
	at org.apache.hadoop.mapred.MapTask.runNewMapper(
	at org.apache.hadoop.mapred.Child.main(

It looks like the code in wasn't accepting the full range
of Signed Longs (MIN_SIGNED_VAR_LONG = -(1L << 62) instead of
MIN_SIGNED_VAR_LONG = -(1L << 63)).

When I increase the max/min value it breaks on the negative check in
writeUnsignedVarLong....which seems like it shouldn't be there because
the number can be "interpreted" as negative since we're storing an
unsigned long in a signed long (since Java has no unsigned). So, when
I remove that check it breaks with "Variable length quantity is too
long" in the readUnsignedVarLong....and this is where things get fuzzy
for me. I basically replaced the code in both the readUnsigned blocks
with the Google code that is referenced. I also replaced the
DecodeZigZag blocks with the Google code. I then commented out the
exception tests and everything ran fine for me....with the other tests
passing I felt like like the end-to-end conversion was working, but
I'm not in a position to really validate my recommendations yet.

So perhaps if my technique sounds reasonable maybe someone could apply
the patch I've attached and check out the results on a known sample?

Loving Mahout so far, thanks all!


  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message