How to create a Dataset from custom class Person?
问题 I was trying to create a Dataset in Java, so I write the following code: public Dataset createDataset(){ List<Person> list = new ArrayList<>(); list.add(new Person("name", 10, 10.0)); Dataset<Person> dateset = sqlContext.createDataset(list, Encoders.bean(Person.class)); return dataset; } Person class is an inner class. Spark however throws the following exception: org.apache.spark.sql.AnalysisException: Unable to generate an encoder for inner class `....` without access to the scope that this