I am using Spark 1.6
The below udf is used to clean address data.
sqlContext.udf.register("cleanaddress", (AD1:String,AD2: String, AD3:String)=>Boolean = _.matches("^[a-zA-Z0-9]*$"))
UDF Name : cleanaddress Three input parameter is coming from DataFrame column,(AD1,AD2 and AD3).
May someone please help me to fix the below error.
i am trying to write udf which accept three parameter (3 address column of dataframe), compute and give only the filter records.
Error:
Error:(38, 91) reassignment to val
sqlContext.udf.register("cleanaddress", (AD1:String, AD2: String, AD3:String)=>Boolean = _.matches("^[a-zA-Z0-9]*$"))