private void validatedMapping ( Descriptor descriptor , GroupType parquetSchema ) { List < FieldDescriptor > allFields = descriptor . getFields ( ) ; for ( FieldDescriptor fieldDescriptor : allFields ) { String fieldName = fieldDescriptor . getName ( ) ; int fieldIndex = fieldDescriptor . getIndex ( ) ; int parquetIndex = parquetSchema . getFieldIndex ( fieldName ) ; if ( fieldIndex != parquetIndex ) { String message = "FieldIndex mismatch name=" + fieldName + ": " + fieldIndex + " != " + parquetIndex ; throw new IncompatibleSchemaModificationException ( message ) ; } } }
validates mapping between protobuffer fields and parquet fields .