I want to use the fonction **"doublemetaphone"** on my data set on **pyspark**.
The expectation result is a boolean: TRUE or FALSE.
But *@udf("bool")* doesn't work, is there another way?
from metaphone import doublemetaphone
@udf("bool")
def udf_doublemetaphone(a,b):
return doublemetaphone(a)== doublemetaphone(b)
data_set_doublemetaphone = (data_set.withColumn("doublemetaphone",
udf_doublemetaphone(col("A"),col("B")))) ```
I have find!
This is @udf(BooleanType())
So you can use like this: rom metaphone import doublemetaphone