In Spark SQL when I tried to use map function on DataFrame then I am getting below error.
The method map(Function1, ClassTag) in the type DataFrame is not applicab
Change this to:
Java 6 & 7
List teenagerNames = teenagers.javaRDD().map(
new Function() {
public String call(Row row) {
return "Name: " + row.getString(0);
}
}).collect();
Java 8
List t2 = teenagers.javaRDD().map(
row -> "Name: " + row.getString(0)
).collect();
Once you call javaRDD() it works just like any other RDD map function.
This works with Spark 1.3.0 and up.