[ad_1]
I have a multiple expressions which is stored as string like below
CHECKFILTER1 = "trim(col(column)).rlike(REGEXFORINT) || col(column).isNull"
CHECKFILTER2 = "when(trim(col(column)).rlike(REGEXFORINT) || df(column).isNull,null).otherwise(col(column))"
CHECKFILTER3 = "when(trim(col(column)).rlike(REGEXFORINT) || df(column).isNull,null).otherwise(column)"
My requirement here is to execute these string expressions on a dataframe using spark dataframe API in scala.
I tried using below but this didn’t work
df.withColumn(column,expr(s”$column ${CHECKFILTER1}”)
[ad_2]