0

The nested schema can be struct of struct or array of struct or more complex and we are given a column name to drop from the dataframe.

Found this but the code is in scala and I don't have any knowledge of scala, this is exactly what I want

|-- details: array 
 |    |-- element: struct
 |    |    |-- source_id: string 
 |    |    |-- destination_id: string 
 |    |    |-- items: array 
 |    |    |    |-- element: struct 
 |    |    |    |    |-- data: array 
 |    |    |    |    |    |-- element: struct 
 |    |    |    |    |    |    |-- amount: integer
 |    |    |    |    |    |    |-- percent: double 
 |    |    |    |    |-- id: string 
 |    |    |    |    |-- period: struct 
 |    |    |    |    |    |-- end: long 
 |    |    |    |    |    |-- start: long 

The schema is like this and the list contains [details.items.element.amount]. I want to automate the process of dropping columns from the list and the data inside dataframe should be kept.

0 Answers0