输入banner图图片脚本导航/分类

SparkSql 隐式转换异常

You can wrap your type with Tuple1 if you do want top level null Product objects, e.g. instead of creating `Dataset[Option[MyClass]]`, you can do something like `val ds: Dataset[Tuple1[MyClass]] = Seq(Tuple1(MyClass(...)), Tuple1(null)).toDS`

二、原因和解决方法

此问题主要是由于将data[Row]转换成对应的的dataSet类型时,找不到对应的类型转换导致的,需要为对应的类型添加隐式转换,一般添加代码:

implicit val registerKryoEncoder = Encoders.kryo[MyClass]

SparkSql 隐式转换异常

标签:异常   lin   div   top   evel   key   name   product   dataset