Pyspark Accessing And Exploding Nested Items Of A Json
I'm very new to spark and i'm trying to parse a json file containing data to be aggregated but i can't manage to navigate its content. I searched for for other solutions but i wasn
Solution 1:
You cannot access directly nested arrays, you need to use explode
before.
It will create a line for each element in the array.
from pyspark.sql import functions as F
df.withColumn("Value", F.explode("Values"))
Post a Comment for "Pyspark Accessing And Exploding Nested Items Of A Json"