Print Schema

Learn how to print the Dataset schema.

df.printSchema

Output:

root
|-- Id: long (nullable = true)
|-- attributes: struct (nullable = true)
| |-- FirstName: array (nullable = true)
| | |-- element: string (containsNull = true)
| |-- LastName: array (nullable = true)
| | |-- element: string (containsNull = true)
| |-- Gender: array (nullable = true)
| | |-- element: string (containsNull = true)
| |-- Specialities: array (nullable = true)
| | |-- element: struct (containsNull = true)
| | | |-- SpecialtyType: array (nullable = true)
| | | | |-- element: string (containsNull = true)
| | | |-- Specialty: array (nullable = true)
| | | | |-- element: string (containsNull = true)
|-- FirstName: string (nullable = true)
|-- LastName: string (nullable = true)
|-- Gender: string (nullable = true)
|-- SpecialtyType: string (nullable = true)
|-- Specialty: string (nullable = true)