If I want to retrieve the Categories, then how can I access the value of the wrapped array of categories the tree is shown as in the image.
Asked
Active
Viewed 833 times
-1
-
1Please don't post images and consider adding a [reproducible example](https://stackoverflow.com/q/48427185/8371915). What output do you want? – Alper t. Turker Jan 26 '18 at 11:23
1 Answers
2
Try this :
from pyspark.sql import functions as F
df.select(F.explode("categories")).show()
another way could be also to use getItems method applied to your column categories.
Steven
- 11,973
- 4
- 33
- 66