Yes, perhaps, but not in the way you hope. The type class IsSerializable can provide a mechanism for converting your T to a type value guaranteed by Serializable and vice versa.
trait IsSerializable[T] { def toSerializable(t: T): String def fromSerializable(s: String): Option[T] }
But, of course, it's just an alternative serialization mechanism based on a class of classes, which in itself, which makes the use of JVM serialization redundant.
Your best course of action has been to lobby Spark to directly support class-based serialization.
source share