sparksql error

Error when executing:

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.;

Workaround: case class Person (name: String, age: Int) This sample class moved outside the parent class is moved to the outermost, do not let it include any class.

 

Guess you like

Origin www.cnblogs.com/mediocreWorld/p/11614361.html