Since the ST_GeomFromText is not the part of org.apache.spark.sql.functions so it will not recognise it internally.I need to first define the UDF for this function. means I need to define the definition of that function and then register that function with spark as UDF then only I can use this function.
I got stuck in beginning to define this function, what parameters will take.
EDIT
The code I used is as follows :
sparkSession.udf().register("ST_GeomFromText", new UDF1<String, String>() {
@Override
public String call(String txt ) {
return (new ST_GeomFromText(txt));
}
}, DataTypes.StringType);
I really need your help.
Thank you