I want to create a column called "quelle" filled with a lit("XY") if another column contains a certain substring. The code I wrote like this:
df => df.withColumn("quelle", when(substring_of_other_column.contains("123"), lit("XY")))
But i get the error: Type mismatch: Required column, found boolean.
Any help will be appreciated, thank you.