I have a column, which is of type array < string > in spark tables. I am using SQL to query these spark tables. I wanted to convert the array < s
array < string >
array < s
You can cast array to string at create this df not at output
newdf = df.groupBy('aaa') .agg(F.collect_list('bbb').("string").alias('ccc')) outputdf = newdf.select( F.concat_ws(', ' , newdf.aaa, F.format_string('xxxxx(%s)', newdf.ccc)))