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 39A8E1016C for ; Mon, 9 Sep 2013 21:23:06 +0000 (UTC) Received: (qmail 88326 invoked by uid 500); 9 Sep 2013 21:23:05 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 88213 invoked by uid 500); 9 Sep 2013 21:23:04 -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 86225 invoked by uid 99); 9 Sep 2013 21:22:53 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Sep 2013 21:22:53 +0000 Date: Mon, 9 Sep 2013 21:22:53 +0000 (UTC) From: "Thiruvalluvan M. G. (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AVRO-1360) C++ Resolving decoder is not working 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-1360?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Thiruvalluvan M. G. updated AVRO-1360: -------------------------------------- Attachment: AVRO-1360-3.patch =20 > C++ Resolving decoder is not working when reader schema has more fields t= han writer schema > -------------------------------------------------------------------------= ----------------- > > Key: AVRO-1360 > URL: https://issues.apache.org/jira/browse/AVRO-1360 > Project: Avro > Issue Type: Bug > Components: c++ > Affects Versions: 1.7.4 > Reporter: Ramana Suvarapu > Assignee: Thiruvalluvan M. G. > Attachments: AVRO-1360-2.patch, AVRO-1360-3.patch, AVRO-1360.patc= h, testreader, testreader-1, testreader.hh, testwriter, testwriter-1, testw= riter.hh > > > 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 > =20 > Can you please let us know if there are any other limitations with c++ im= plementation of ResolvingDecoder? We are planning to use it in our project = and we want to make sure it works as per avro specification. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira