Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2023 08:06 AM
Hello!
An elegant way of defining an empty column in a dataframe is to mention as
df.withColumn("New_Column", lit(None).cast(StringType()))
If you are just working with dataframes ( and no file formats are involved) you can also work with NullType().