private Map < String , Field > populateRecordFields ( Map < String , Field > fields ) { if ( fields == null ) { return null ; } Map < String , Schema > knownRecordSchemas = Maps . newHashMap ( ) ; knownRecordSchemas . put ( recordName , this ) ; ImmutableMap . Builder < String , Field > builder = ImmutableMap . builder ( ) ; for ( Map . Entry < String , Field > fieldEntry : fields . entrySet ( ) ) { String fieldName = fieldEntry . getKey ( ) ; Field field = fieldEntry . getValue ( ) ; Schema fieldSchema = resolveSchema ( field . getSchema ( ) , knownRecordSchemas ) ; if ( fieldSchema == field . getSchema ( ) ) { builder . put ( fieldName , field ) ; } else { builder . put ( fieldName , Field . of ( fieldName , fieldSchema ) ) ; } } return builder . build ( ) ; }
Resolves all field schemas .