Reputation: 60054
Given a SchemaRDD
(loaded using SQLContext.parquetFile
), how do I extract its metadata/schema/list of columns?
Upvotes: 0
Views: 208
Reputation: 2360
There is also a printSchema()
method under SchemaRDD
, see SchemaRDD.
Upvotes: 0
Reputation: 10941
The field list is accessible through the SchemaRDD
as [rdd].schema.fields
.
lazy val schema: StructType Returns the schema of this SchemaRDD (represented by a StructType).
Upvotes: 3