title: Create MySQL Statement into Spark SQL Statement
body: <p>How do I convert this MySQL statement into a spark SQL statement?</p>
  
  <pre><code>set_engagement_sql = """ UPDATE """ + my_table_name + """ SET 
                  Engagement = CASE 
                      WHEN LinkedAccountId = '1234567890101' THEN '800000046406'
                      WHEN LinkedAccountId = '1234567890102' THEN '803000006453'
                      WHEN LinkedAccountId IN ('1234567890103', '12345678901014') THEN '800000043270'
                      WHEN LinkedAccountId IN ('1234567890105', '1234567890106') THEN '400000008426'
                      WHEN LinkedAccountId IN ('1234567890106', '1234567890107') THEN '807000000401'
                      WHEN LinkedAccountId IN ('1234567890108', '1234567890109', '1234567890110', '1234567890111') THEN '808000000298'
                      WHEN LinkedAccountId IN ('1234567890112', '1234567890113', '1234567890114', '1234567890115') THEN '800000047650'
                      WHEN LinkedAccountId IN ('1234567890116', '1234567890117', '1234567890118','1234567890119', '1234567890120','1234567890121', '123456789022', '1234567890123', '1234567890124', '1234567890125') THEN '800000039768'
                      WHEN LinkedAccountId IN ('1234567890126', '1234567890126', '1234567890127', '1234567890128', '1234567890129', '1234567890128', '1234567890129', '1234567890130', '1234567890131', '1234567890131',  '1234567890132', '1234567890133') THEN '400000008692'
                      WHEN LinkedAccountId IN ('1234567890134', '1234567890135', '1234567890136', '1234567890137',  '1234567890138', '1234567890138', '1234567890139', '1234567890140', '1234567890141',  '1234567890142', '1234567890143', '1234567890144', '1234567890145', '1234567890146') THEN '400000008378' 
                      ELSE '800000039768'
                  END
                  WHERE Engagement IS NULL OR Engagement RLIKE '^[a-zA-Z]'; """
  </code></pre>
  
  <p>I tried doing this in pyspark, but it's throwing off the results. I think this might work better if I can get it working. </p>