sparksql报错

执行时报错:

org.apache.spark.sql.AnalysisException: Unable to generate an encoder for inner class `cn.itcast.spark.sql.Intro$Person` without access to the scope that this class was defined in.
Try moving this class out of its parent class.;

解决方法:将case class Person(name:String,age:Int)这个样例类移动到父类的外面,就是移到最外面,不要让其包含任何的类中。

猜你喜欢

转载自www.cnblogs.com/mediocreWorld/p/11614361.html
今日推荐