I've got a DF with "b" column with a patter 'a|b|c|...|z' like this:
from pyspark import Row
from pyspark.sql import SparkSession
spark = SparkSession.builder \
.appName('DataFrame') \
.master('local[*]') \
.getOrCreate()
| a| b| c| d|
+---+-----------+------------+-----+
| 1|1|2|3|4|5|6|[11, 22, 33]|[foo]|
+---+-----------+------------+-----+
I would like to change the "b" column to a list in order to next explode it and do additional processing, so it should look like this:
| a| b| c| d|
+---+------------------+------------+-----+
| 1|[1, 2, 3, 4, 5, 6]|[11, 22, 33]|[foo]|
+---+------------------+------------+-----+
Hope you can help.