I am using the below code to generate some output file , the sample code is not showing the values however the count is correct
public static void main(String[] args) {
SparkSession sess = SparkSession.builder().master("local[2]").getOrCreate();
List<String> x = new ArrayList<>();
for(int i=0 ; i <100; i++)
x.add("random"+i);
MapFunction<String , Position> mapFunction = new MapFunction<String, Position>() {
@Override
public Position call(String s) throws Exception {
Position p = new Position();
p.setPid(s);
return p;
}
};
Dataset<String> dataset = sess.createDataset(x, Encoders.STRING());
Dataset<Position> map = dataset.map(mapFunction, Encoders.bean(Position.class));
map.show();
}
If i am using any primitive type it is working , for any custom java class it is not working , spark version is 2.4.5 can not change this version the Pojo is having only one field for test ,
Please help me to understand why this simple this is not workig
output like below
++
||
++
||
||
||
||
||