sds
sds

Reputation: 60054

Schema from SchemaRDD?

Given a SchemaRDD (loaded using SQLContext.parquetFile), how do I extract its metadata/schema/list of columns?

Upvotes: 0

Views: 208

Answers (2)

Zouzias
Zouzias

Reputation: 2360

There is also a printSchema() method under SchemaRDD, see SchemaRDD.

Upvotes: 0

Mike Park
Mike Park

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

Related Questions