I have an array of list.
array([1,2,3,4.....,50])
I want to add each element in this list as a new column to my current spark dataframe. Something like this
col1|col2|new_col
-------------------
a |aa |1
-------------------
b |bb |2
-------------------
c |cc |3
-------------------
d |dd |4
-------------------
...
...
...
...
-------------------
z |zz |50
--------------------
withColumn seems to not work for something like this.