from pyspark.sql.functions import col, when valueWhenTrue = None # for example df.withColumn( "existingColumnToUpdate", when( col("userid") == 22650984, valueWhenTrue ).otherwise(col("existingColumnToUpdate")) )