Spark dataset encoders: kryo() vs bean()
问题 While working with datasets in Spark, we need to specify Encoders for serializing and de-serializing objects. We have option of using Encoders.bean(Class<T>) or Encoders.kryo(Class<T>) . How are these different and what are the performance implications of using one vs another? 回答1: It is always advisable to use Kryo Serialization to Java Serialization for many reasons. Some of them are below. Kryo Serialization is faster than Java Serialization. Kryo Serialization uses less memory footprint