How to create a custom Encoder in Spark 2.X Datasets?

后端 未结 3 1501
心在旅途
心在旅途 2021-02-01 06:08

Spark Datasets move away from Row\'s to Encoder\'s for Pojo\'s/primitives. The Catalyst engine uses an ExpressionEncoder to convert column

3条回答
  •  别那么骄傲
    2021-02-01 06:37

    Did you import the implicit encoders?

    import spark.implicits._

    http://spark.apache.org/docs/2.0.0-preview/api/scala/index.html#org.apache.spark.sql.Encoder

提交回复
热议问题