[ https://issues.apache.org/jira/browse/AVRO-1474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975579#comment-13975579 ]
Ramana Suvarapu commented on AVRO-1474: --------------------------------------- Yes. You can commit this. I created separate JIRA for handling Avro aliases. Please include #include <stdint.h> to GenericDatum.hh. We are getting compilation errors when compiling on Windows. Also please add -DBOOST_IOSTREAMS_DYN_LINK to CMakeLists.txt to following section. This is to fix Windows compilation errors. if (WIN32 AND NOT CYGWIN AND NOT MSYS) add_definitions (/EHa) add_definitions ( -DBOOST_REGEX_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_ALL_NO_LIB) endif() > C++ resolvind decoder doesn't work when reader schema has more fields than > writer schema > ---------------------------------------------------------------------------------------- > > Key: AVRO-1474 > URL: https://issues.apache.org/jira/browse/AVRO-1474 > Project: Avro > Issue Type: Bug > Components: c++ > Affects Versions: 1.7.6 > Reporter: Ramana Suvarapu > Assignee: Thiruvalluvan M. G. > Attachments: AVRO-1474.patch, reader, writer > > > When reader schema has more number of fields than writer schema, C++ > implementation of resolving decoder is throwing exception "throwing exception > "Don't know how to handle excess fields for reader.” with out checking > whether fields are optional or fields have default values. > Attached are reader and writer schemas. Record in reader schema has 2 > additional fields than writer schema. One field is required field but it has > default value and another one is optional field (union of null and string). > Since one has default value and another is optional both reader and writer > schemas are supposed to be compatible. > > {"name": "defaultField", "type": "string", "default": "DEFAULT", > "declared":"true"}, > {"name": "optionalField", "type": ["string", "null"],"declared":"true"}, > > main() > { > avro::ValidSchema readerSchema = load("reader.json"); > avro::ValidSchema writerSchema = load("writer.json"); > avro::DecoderPtr d = avro::resolvingDecoder(writerSchema, > readerSchema,avro::binaryDecoder()); > } > > But when I tried to create resolving decoder, I am getting "Don't know how to > handle excess fields for reader.” But Java implementation works. > Also field ordering is not working. > The same issue is reported in AVRO-1360. -- This message was sent by Atlassian JIRA (v6.2#6252)