scalding
scalding copied to clipboard
TypedText defaults to converting unparsed numbers to 0
A user has a case class wrapping a Long
. The tsv had a string that could not be parsed as long, and the use got 0L
for the Long.
I think we should throw in this case.
One interesting idea would be to have Try[Long]
be the way to specify you want to catch exceptions in parsing. @ianoc has done similar tricks in some macros which I think worked out well.
Another thing we might think about is to allow the last parameter to be a List[String]
to catch uneven tsvs which may sometimes have extra columns. Don't know how big of a deal this is.
We may not want to use cascading's parsing for this since with TypedText we have a macro that could directly generate the function of String => Try[T]
.