📅  最后修改于: 2022-03-11 14:46:10.704000             🧑  作者: Mango
# PYSPARK DATAFRAME API
from pyspark.sql.functions import when
df.select("*",when(df.value == 1, 'one'
).when(df.value == 2, 'two'
).otherwise('other'))