Description
For a DataFrame schema with nested StructTypes, where metadata is set for fields in the schema, that metadata is lost when a DataFrame selects nested fields. For example, suppose
df.schema.fields[0].dataType.fields[0].metadata
returns a non-empty dictionary, then
df.select('Field0.SubField0').schema.fields[0].metadata
returns an empty dictionary, where "Field0" is the name of the first field in the DataFrame and "SubField0" is the name of the first nested field under "Field0".