Modify nested struct column and concat string to same column in pyspark

Viewed 27

I have this below schema

root
|-- Item: struct
|    |-- SK: struct
|    |    |-- N: string

I want to modify the 'N' to 'S'. Typically a value in the Item would be a two level nested {{123},{abc},....{},{}} I want to concatenate a custom string to 123 and my final output should look like the below {{xyz123},{abc},....{},{}}

I have tried with df.withColumn and df.select and tried using withField but no luck.

0 Answers
Related