twitter/scalding — pull request #309 by ccsevers (2013-02-12 00:29:42+00:00)
Title: Add a version of write to TypedPipe that takes a Mappable in order to catch type errors at compile time

For things like Avro support it would be nice to catch type errors before runtime. As it is now if you pass in a PackedAvroSource[T] to write and the incoming data is not a T then you're probably going to get a runtime error. Having a write that takes Mappable[T] will catch this at compile time. This will also work for TypedTsv[T] and WritableSequenceFile[K,V] (if they are made to be mappable).

I didn't add any new tests since it's really a compile time catch but all current tests still pass.

I have one small issue that maybe you can help with before accepting this. I would really like to do something like
blahblah.write(myMappable("some path"))
and have it infer the type for myMappable. Right now however since write has type [U >: T] it seems to have trouble guessing what U should be, leading to some diverging implicits messages. Is there an easy fix for this? I can post more specifics on the group if this isn't clear.