'A record is encoded by encoding the values of its fields
in the order that they are declared. In other words, a record
is encoded as just the concatenation of the encodings of its fields.
Field values are encoded per their schema.
Schema Resolution:
* the ordering of fields may be different: fields are matched by name.
* schemas for fields with the same name in both records are resolved
recursively.
* if the writer\'s record contains a field with a name not present in the
reader\'s record, the writer\'s value for that field is ignored.
* if the reader\'s record schema has a field that contains a default value,
and writer\'s schema does not have a field with the same name, then the
reader should use the default value from its field.
* if the reader\'s record schema has a field with no default value, and
writer\'s schema does not have a field with the same name, then the
field\'s value is unset.'

def read_record(self, writers_schema, readers_schema, decoder):

    readers_fields_dict = readers_schema.fields_dict
    read_record = {}
    for field in writers_schema.fields:
        readers_field = readers_fields_dict.get(field.name)
        if (readers_field is not None):
            field_val = self.read_data(field.type, readers_field.type, decoder)
            read_record[field.name] = field_val
        else:
            self.skip_data(field.type, decoder)
    if (len(readers_fields_dict) > len(read_record)):
        writers_fields_dict = writers_schema.fields_dict
        for (field_name, field) in readers_fields_dict.items():
            if (not writers_fields_dict.has_key(field_name)):
                if field.has_default:
                    field_val = self._read_default_value(field.type, field.default)
                    read_record[field.name] = field_val
                else:
                    fail_msg = ('No    default    value    for    field    %s' % field_name)
                    raise SchemaResolutionException(fail_msg, writers_schema, readers_schema)
    return read_record
