public static Schema superSetOf ( String newName , Schema schema , Field ... newFields ) { List < Field > newSchema = new ArrayList < Field > ( ) ; newSchema . addAll ( schema . getFields ( ) ) ; for ( Field newField : newFields ) { newSchema . add ( newField ) ; } return new Schema ( newName , newSchema ) ; }
Creates a superset of the input Schema taking all the Fields in the input schema and adding some new ones . The new fields are fully specified in a Field class . The name of the schema is also specified as a parameter .