A transform to add new nullable fields to a PCollection's schema. Elements are extended to have
the new schema. By default new fields are nullable, and input rows will be extended to the new
schema by inserting null values. However explicit default values for new fields can be set using
AddFields.Inner.field(String, Schema.FieldType, Object)
. Nested fields can be added as well.
Example use:
PCollection<Event> events = readEvents();
PCollection<Row> augmentedEvents =
events.apply(AddFields.<Event>create()
.field("userId", FieldType.STRING)
.field("location.zipcode", FieldType.INT32)
.field("userDetails.isSpecialUser", "FieldType.BOOLEAN", false));