DataFrame reslt = sqlContext.createDataFrame(
srcDatafr.javaRDD().map(row -> {
return RowFactory.create(row.get(0), row.get(1), row.get(2), "You value", row.get(4) );
}), srcDatafr.schema());
reslt.printSchema();
reslt.show();
}
Very beautiful solution, get it here.
No comments:
Post a Comment