Just out of curiosity why are you trying to use a UDF when the
corresponding function is available? Or why not use SQL instead?
Regards,
Gourav
On Tue, Jul 9, 2019 at 7:25 PM Femi Anthony wrote:
> How can I achieve the following by passing a row to a udf ?
>
>
> *val df1 = df.withColumn("co
How can I achieve the following by passing a row to a udf ?
val df1 = df.withColumn("col_Z",
when($"col_x" === "a", $"col_A")
.when($"col_x" === "b", $"col_B")
.when($"col_x" === "c", $"col_C")
.when($"col_x" === "d", $"c