df.withColumn("Test", lit(null)).show() +----+--------+-----+----+ |Hour|Category|Value|Test| +----+--------+-----+----+ | 0| cat26| 30.9|null| | 1| cat67| 28.5|null| | 2| cat56| 39.6|null| | 3| cat8| 35.6|null| +----+--------+-----+----+
2024-01-20 21:05:34
df.withColumn("Test", lit(null)).show() +----+--------+-----+----+ |Hour|Category|Value|Test| +----+--------+-----+----+ | 0| cat26| 30.9|null| | 1| cat67| 28.5|null| | 2| cat56| 39.6|null| | 3| cat8| 35.6|null| +----+--------+-----+----+