scala> schemaTyped("a").getComment res0: Option[String] = None scala> schemaTyped("a").withComment("this is a comment").getComment res1: Option[String] = Some(this is a comment)
StructField describes a single field in a StructType. It has a name, the type and whether or not it be empty, and an optional metadata and a comment.
A comment is a part of metadata under
comment key and is used to build a Hive column or when describing a table.