I have a column in a dataframe with timestamp data type. The problem is that I need to concatenate it row wise with a column from another dataframe using union/unionByName, but... I know that for this to work data types must be identical. So, I need to convert this column into an array so that it'll match the other dataframe's column.
I've tried the following approaches, but it won't work...
df_2 = df.withColumn('date', F.lit(datetime.now(), F.collect_set('date'))
df_2 = df.withColumn('date', F.lit(datetime.now()).withColumn('date', F.collect_set('date').alias('date'))