Return-Path: X-Original-To: apmail-avro-dev-archive@www.apache.org Delivered-To: apmail-avro-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C719410D6A for ; Mon, 3 Mar 2014 19:30:49 +0000 (UTC) Received: (qmail 81560 invoked by uid 500); 3 Mar 2014 19:30:40 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 81354 invoked by uid 500); 3 Mar 2014 19:30:35 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 81058 invoked by uid 99); 3 Mar 2014 19:30:30 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Mar 2014 19:30:30 +0000 Date: Mon, 3 Mar 2014 19:30:30 +0000 (UTC) From: "Ramana Suvarapu (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AVRO-1474) C++ resolvind decoder doesn't work when reader schema has more fields than writer schema MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AVRO-1474?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Ramana Suvarapu updated AVRO-1474: ---------------------------------- Description:=20 When reader schema has more number of fields than writer schema, C++ implem= entation of resolving decoder is throwing exception "throwing exception "Do= n't know how to handle excess fields for reader.=E2=80=9D with out checking= whether fields are optional or fields have default values. Attached are reader and writer schemas. Record in reader schema has 2 addit= ional fields than writer schema. One field is required field but it has def= ault value and another one is optional field (union of null and string). Si= nce one has default value and another is optional both reader and writer sc= hemas are supposed to be compatible.=20 =20 {"name": "defaultField", "type": "string", "default": "DEFAULT", "declared"= :"true"}, =20 {"name": "optionalField", "type": ["string", "null"],"declared":"true"}, =20 main() { avro::ValidSchema readerSchema =3D load("reader.json"); avro::ValidSchema writerSchema =3D load("writer.json"); avro::DecoderPtr d =3D avro::resolvingDecoder(writerSchema, readerSchema,= avro::binaryDecoder()); } =20 But when I tried to create resolving decoder, I am getting "Don't know how = to handle excess fields for reader.=E2=80=9D But Java implementation works.= =20 Also field ordering is not working.=20 The same issue is reported in AVRO-1360. was: When reader schema has more number of fields than writer schema, C++ implem= entation of resolving decoder is throwing exception "throwing exception "Do= n't know how to handle excess fields for reader.=E2=80=9D with out checking= whether fields are optional or fields have default values. Attached are reader and writer schemas. Record in reader schema has 2 addit= ional fields than writer schema. One field is required field but it has def= ault value and another one is optional field (union of null and string). Si= nce one has default value and another is optional both reader and writer sc= hemas are supposed to be compatible.=20 =20 {"name": "defaultField", "type": "string", "default": "DEFAULT", "declared"= :"true"}, =20 {"name": "optionalField", "type": ["string", "null"],"declared":"true"}, =20 main() { avro::ValidSchema readerSchema =3D load("reader.json"); avro::ValidSchema writerSchema =3D load("writer.json"); avro::DecoderPtr d =3D avro::resolvingDecoder(writerSchema, readerSchema,= avro::binaryDecoder()); } =20 But when I tried to create resolving decoder, I am getting "Don't know how = to handle excess fields for reader.=E2=80=9D But Java implementation works.= =20 Also field ordering is not working.=20 > C++ resolvind decoder doesn't work when reader schema has more fields tha= n 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: reader, writer > > > When reader schema has more number of fields than writer schema, C++ impl= ementation of resolving decoder is throwing exception "throwing exception "= Don't know how to handle excess fields for reader.=E2=80=9D with out checki= ng whether fields are optional or fields have default values. > Attached are reader and writer schemas. Record in reader schema has 2 add= itional fields than writer schema. One field is required field but it has d= efault 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.=20 > =20 > {"name": "defaultField", "type": "string", "default": "DEFAULT", "declare= d":"true"}, =20 > {"name": "optionalField", "type": ["string", "null"],"declared":"true"}, > =20 > main() > { > avro::ValidSchema readerSchema =3D load("reader.json"); > avro::ValidSchema writerSchema =3D load("writer.json"); > avro::DecoderPtr d =3D avro::resolvingDecoder(writerSchema, readerSchem= a,avro::binaryDecoder()); > } > =20 > But when I tried to create resolving decoder, I am getting "Don't know ho= w to handle excess fields for reader.=E2=80=9D But Java implementation work= s. =20 > Also field ordering is not working.=20 > The same issue is reported in AVRO-1360. -- This message was sent by Atlassian JIRA (v6.2#6252)