I am implementing a spark process in java, and want to make, from a RDD of the same parametrized type, a Dataset<Try<MyPojo>>
for some own made MyPojo class and where Try
is the scala Try
. In scala, the encoder would be made implicitly, but in java I need to provide it explicitly.
Now, I can get a working Encoder<MyPojo>
using Encoders.bean(MyPojo.class)
. And I expect that there is some code to build an Encoder<Try<T>>
from an Encoder<T>
that is used by the scala implicit. But I cannot find it.
[Note: I just tried in scala and no implicit was found for type Try... So the question is valid in scala too]
So, how am I supposed to do?