我想不出一种方法将测试对象列表转换为 Spark 中的数据集这是我的课程:
public class Test {
public String a;
public String b;
public Test(String a, String b){
this.a = a;
this.b = b;
}
public List getList(){
List l = new ArrayList();
l.add(this.a);
l.add(this.b);
return l;
}
}
Run Code Online (Sandbox Code Playgroud)