title: Convert SQL Statement into PySpark
body: <p>I have a statement in MySQL that I'm trying to convert into PySpark:</p>
  
  <pre><code>my_table_name = default_engagements
  UPDATE """ + my_table_name + """ SET Engagement = CASE WHEN LinkedAccountId IN ('123456778910', '1098765432123', '254325678912', '429576512356') THEN '808000000298' END WHERE Engagement IS NULL OR Engagement RLIKE '^[a-zA-Z]'; """
  </code></pre>
  
  <p>I've found this example in python spark: </p>
  
  <pre><code>from pyspark.sql import functions as F
  update_func = (F.when(F.col('update_col') == replace_val, new_value)
                  .otherwise(F.col('update_col')))
  </code></pre>
  
  <p>But I don't know how to adapt that to the above SQL. Can someone help me with the syntax? I want to convert the new info into a DF so I can write the new DF to S3.</p>