Case when statement with IN clause in Pyspark
<p>I am new to Spark programming and have a scenario to assign a value when a set of values appear in my input. Below is a tradition SQL code I would use to accomplish my task. Need to do the same in Spark.</p>

<p>Sql Code: </p>

<pre><code>SELECT CASE WHEN c.Number IN ( '1121231', '31242323' ) THEN 1 
ELSE 2 END AS Test
FROM   Input  c
</code></pre>

<p>I am aware of using <code>when</code> in spark with just one condition.</p>

<pre><code>Input.select(when(Input.Number==1121231,1).otherwise(2).alias("Test")).show()
</code></pre>