I'm looking to apply the 'rlike' function on a column, however instead of a standard regular expression string I want to be able to input a column (which is a regular expression string).
ie. $col1.rlike($col2)
where $col2 is in a regular expression format within the dataframe
I have tried applying a UDF:
def rLike = udf((s: String, col: Column) => col.rlike(s))
This keeps giving me the error:
java.lang.UnsupportedOperationException: Schema for type org.apache.spark.sql.Column is not supported
Could anyone please shed some light on how I can fix this.
col: Columntocol: Stringshould work. The column type is a string so that is the correct input type to an udf. - Shaido