Question:
Below is the input dataframe.If the flag column is 1, I will do the below.
Thank you.
Answer:
Possible duplicate of this question.You need to use
when
with (or without) otherwise
from pyspark.sql.functions
.If you have better answer, please add a comment about this, thank you!