diff --git a/pyspark-lit.py b/pyspark-lit.py index 795d4cd..f8cf6d8 100644 --- a/pyspark-lit.py +++ b/pyspark-lit.py @@ -20,5 +20,5 @@ from pyspark.sql.functions import when -df3 = df2.withColumn("lit_value2", when(col("Salary") >=40000 & col("Salary") <= 50000,lit("100")).otherwise(lit("200"))) -df3.show(truncate=False) \ No newline at end of file +df3 = df2.withColumn("lit_value2", when((col("Salary") >= 40000) & (col("Salary") <= 50000), lit("100")).otherwise(lit("200"))) +df3.show(truncate=False)