I have a DataFrame df with the following schema:
root
|-- car: string (nullable = true)
|-- person: struct (nullable = true)
| |-- age: long (nullable = true)
| |-- name: string (nullable = true)
Then I do: new_df = df.drop("person.name"). I also tried df.drop(col("person.name")) The schema of new_df:
root
|-- car: string (nullable = true)
|-- person: struct (nullable = true)
| |-- age: long (nullable = true)
| |-- name: string (nullable = true)
The schema of new_df has not changed. Any idea why?
Assuming I want a final result with (person.age, car), how to do it?