I have two Dataframe and I want when the column CONCERN of Dataframe2 contains 'all' the anwser in the new column "EFFECTIFITY" (in the same dataframe) is a list off all the serial number "SN" of the column "SN" in the Dataframe1
df1 = Dataframe1 df2 = Dataframe2
all_data = df1.select(collect_list("SN")).show()
df = df.withColumn("EFFECTIVITY", F.when(df2.CONCERN.contains('ALL'), all_data).otherwise(''))