Spark When Function Example, I am dealing with transforming SQL code to PySpark code and came across some SQL statements.