Try this-
spark>=2.4
Use combination of translate and regex_replace
val df = Seq("[[,,hello,yes],[take,no,I,m],[hi,good,,]]").toDF("table")
df.show(false)
df.printSchema()
/**
* +-----------------------------------------+
* |table |
* +-----------------------------------------+
* |[[,,hello,yes],[take,no,I,m],[hi,good,,]]|
* +-----------------------------------------+
*
* root
* |-- table: string (nullable = true)
*/
val p = df.withColumn("arr", split(
translate(
regexp_replace($"table", """\]\s*,\s*\[""", "##"), "][", ""
), "##"
))
val processed = p.withColumn("arr", expr("TRANSFORM(arr, x -> split(x, ','))"))
processed.show(false)
processed.printSchema()
/**
* +-----------------------------------------+----------------------------------------------------+
* |table |arr |
* +-----------------------------------------+----------------------------------------------------+
* |[[,,hello,yes],[take,no,I,m],[hi,good,,]]|[[, , hello, yes], [take, no, I, m], [hi, good, , ]]|
* +-----------------------------------------+----------------------------------------------------+
*
* root
* |-- table: string (nullable = true)
* |-- arr: array (nullable = true)
* | |-- element: array (containsNull = true)
* | | |-- element: string (containsNull = true)
*/