-1

I'm getting output as list value as shown below [Row(column1='a,b,c,d')]

how to convert this to string value needed output: 'a,b,c,d'

how to achieve this using python/pyspark?

  • Does this answer your question? [Convert list to string using python](https://stackoverflow.com/questions/33629703/convert-list-to-string-using-python) – damianesteban Sep 19 '22 at 03:52

1 Answers1

0

What you're referring to is just a list of PySpark Row objects, and in order to get values out of those objects, you just need to loop through it

print([r['column1'] for r in df.collect()])
pltc
  • 5,836
  • 1
  • 13
  • 31