Return-Path: X-Original-To: apmail-avro-user-archive@www.apache.org Delivered-To: apmail-avro-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 770EAFE1A for ; Sat, 6 Apr 2013 20:42:15 +0000 (UTC) Received: (qmail 12641 invoked by uid 500); 6 Apr 2013 20:42:15 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 12587 invoked by uid 500); 6 Apr 2013 20:42:15 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 12578 invoked by uid 99); 6 Apr 2013 20:42:15 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Apr 2013 20:42:15 +0000 Received: from localhost (HELO [192.168.2.181]) (127.0.0.1) (smtp-auth username scottcarey, mechanism login) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Apr 2013 20:42:14 +0000 User-Agent: Microsoft-MacOutlook/14.3.2.130206 Date: Sat, 06 Apr 2013 13:42:06 -0700 Subject: Re: Has anyone developed a utility to tell what is missing from a record? From: Scott Carey Sender: Scott Carey To: "user@avro.apache.org" Message-ID: Thread-Topic: Has anyone developed a utility to tell what is missing from a record? In-Reply-To: Mime-version: 1.0 Content-type: multipart/alternative; boundary="B_3448100533_9145349" > This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --B_3448100533_9145349 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Try GenericRecordBuilder. For the Specific API, there are builders that will not let you construct an object that can not be serialized. The Generic API should have the same thing, but I am not 100% sure the builder there covers it. I have always avoided using any API that allows me to create an object that is unsafe to serialize since finding out at serialization time is a huge pain (and in my case, is often on a separate thread from the place it was created). On 4/4/13 6:58 AM, "Jonathan Coveney" wrote: > I'm working on migrating an internally developed serialization format to Avro. > In the process, there have been many cases where I made a mistake migrating > the schema (I've automated it), and then avro cries that a record I'm trying > to serialize doesn't match the schema. Generally, the error it gives doesn't > help find the actual issue, and for a big enough record finding the issue can > be tedious. > > I've thought about making a tool which, given the schema and the record would > tell you what the issue is, but I'm wondering if this already exists? I > suppose the error message could also include this information... > > Thanks > Jon --B_3448100533_9145349 Content-type: text/html; charset="US-ASCII" Content-transfer-encoding: quoted-printable
Try GenericRecordBuilde= r.  

For the Specific API, there are builders = that will not let you construct an object that can not be serialized.
<= div>The Generic API should have the same thing, but I am not 100% sure the b= uilder there covers it.

I have always avoided using= any API that allows me to create an object that is unsafe to serialize sinc= e finding out at serialization time is a huge pain (and in my case, is often= on a separate thread from the place it was created).

On 4/4/13 6:58 AM, "Jonathan C= oveney" <jcoveney@gmail.com> w= rote:

<= div>
I'm working on migrating an internally developed serializ= ation format to Avro. In the process, there have been many cases where I mad= e a mistake migrating the schema (I've automated it), and then avro cries th= at a record I'm trying to serialize doesn't match the schema. Generally, the error it gives doesn't help find = the actual issue, and for a big enough record finding the issue can be tedio= us.

I've thought about making a tool which, given the schema and the record wou= ld tell you what the issue is, but I'm wondering if this already exists? I s= uppose the error message could also include this information...

Thanks
Jon
--B_3448100533_9145349--