A StructField object represents a field in a StructType object.
A StructField object comprises three fields,
String name
,
DataType dataType
,
and
boolean nullable
. The field of
name
is the name of a StructField.
The field of
dataType
specifies the data type of a StructField.
The field of
nullable
specifies if values of a StructField can contain
null
values.
The field of
metadata
provides extra information of the StructField.
To create a
StructField
,
DataType.createStructField(String, DataType, boolean, Metadata)
should be used.