📅  最后修改于: 2022-03-11 14:46:05.749000             🧑  作者: Mango
df5.withColumn("new_column", when(col("code") == "a" | col("code") == "d", "A")
.when(col("code") == "b" & col("amt") == "4", "B")
.otherwise("A1")).show()