public Schema field ( String fieldName , String fieldType ) { if ( tableSchema . containsKey ( fieldName ) ) { throw new ValidationException ( "Duplicate field name $fieldName." ) ; } LinkedHashMap < String , String > fieldProperties = new LinkedHashMap <> ( ) ; fieldProperties . put ( SCHEMA_TYPE , fieldType ) ; tableSchema . put ( fieldName , fieldProperties ) ; lastField = fieldName ; return this ; }
Adds a field with the field name and the type string . Required . This method can be called multiple times . The call order of this method defines also the order of the fields in a row .