If this works in a Spark unit test where it gets mapped out, then the serializability should be good.