I'm quite new to PySpark and coming from SAS I still don't get how to handle parameters (or Macro Variables in SAS terminology).
I have a date parameter like "202105" and want to add it as a String Column to a Dataframe. Something like this:
date = 202105
df = df.withColumn("DATE", lit('{date}'))
I think it's quite trivial but so far, I didn't find an exact answer to my problem, maybe it's just too trivial...
Hope you guys can help me out. Best regards
df.withColumn('DATE', lit(f'{date}'))?df = df.withColumn("DATE", lit(str(date)))