Return-Path: Delivered-To: apmail-avro-dev-archive@www.apache.org Received: (qmail 8208 invoked from network); 28 Aug 2010 05:15:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Aug 2010 05:15:19 -0000 Received: (qmail 15131 invoked by uid 500); 28 Aug 2010 05:15:19 -0000 Delivered-To: apmail-avro-dev-archive@avro.apache.org Received: (qmail 14935 invoked by uid 500); 28 Aug 2010 05:15:17 -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 14834 invoked by uid 99); 28 Aug 2010 05:15:14 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Aug 2010 05:15:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Aug 2010 05:15:14 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o7S5Es06011421 for ; Sat, 28 Aug 2010 05:14:54 GMT Message-ID: <2608227.47591282972494002.JavaMail.jira@thor> Date: Sat, 28 Aug 2010 01:14:54 -0400 (EDT) From: "Harsh J Chouraria (JIRA)" To: dev@avro.apache.org Subject: [jira] Updated: (AVRO-642) Prettify the json dumped during exceptions while validating a writer/reader schema In-Reply-To: <13543452.47571282972493509.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AVRO-642?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Harsh J Chouraria updated AVRO-642: ----------------------------------- Attachment: avro.java.schema.pretty.r1.diff avro.py.schema.pretty.r1.diff Patches for Python and Java that prettify the schema output. > Prettify the json dumped during exceptions while validating a writer/reader schema > ---------------------------------------------------------------------------------- > > Key: AVRO-642 > URL: https://issues.apache.org/jira/browse/AVRO-642 > Project: Avro > Issue Type: Improvement > Components: java, python > Affects Versions: 1.4.0 > Environment: Avro-Trunk > Reporter: Harsh J Chouraria > Assignee: Harsh J Chouraria > Priority: Minor > Fix For: 1.4.0 > > Attachments: avro.java.schema.pretty.r1.diff, avro.py.schema.pretty.r1.diff > > Original Estimate: 0.02h > Remaining Estimate: 0.02h > > Right now the exception that's thrown when a reader and written schema don't match (while reading a file), looks like this: > {noformat} > Found {"type":"record","name":"Test","fields":[{"name":"stringField","type":"string"},{"name":"longField","type":"long"}]}, expecting {"type":"record","name":"Test1","fields":[{"name":"stringField","type":"string"},{"name":"longField","type":"long"}]} > {noformat} > While this is perfectly okay for small schema with a few fields, it gets hard to debug for complex and large ones. > The attached patch changes the exception message to look like: > {noformat} > Found { > "type" : "record", > "name" : "Test", > "fields" : [ { > "name" : "stringField", > "type" : "string" > }, { > "name" : "longField", > "type" : "long" > } ] > }, expecting { > "type" : "record", > "name" : "Test1", > "fields" : [ { > "name" : "stringField", > "type" : "string" > }, { > "name" : "longField", > "type" : "long" > } ] > } > {noformat} > P.s. Ideally a diff-like message would help too, but its mileage may vary. I guess with the pretty output printed, a user may easily do a diff (since they now have newlines), so us providing this is not _really_ needed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.