Return-Path: Delivered-To: apmail-hadoop-avro-user-archive@minotaur.apache.org Received: (qmail 7679 invoked from network); 3 May 2010 17:03:27 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 3 May 2010 17:03:27 -0000 Received: (qmail 1031 invoked by uid 500); 3 May 2010 17:03:27 -0000 Delivered-To: apmail-hadoop-avro-user-archive@hadoop.apache.org Received: (qmail 989 invoked by uid 500); 3 May 2010 17:03:27 -0000 Mailing-List: contact avro-user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: avro-user@hadoop.apache.org Delivered-To: mailing list avro-user@hadoop.apache.org Received: (qmail 981 invoked by uid 99); 3 May 2010 17:03:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 17:03:26 +0000 X-ASF-Spam-Status: No, hits=-72.7 required=10.0 tests=AWL X-Spam-Check-By: apache.org Received: from [140.211.11.9] (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 03 May 2010 17:03:25 +0000 Received: (qmail 7619 invoked by uid 99); 3 May 2010 17:03:05 -0000 Received: from localhost.apache.org (HELO [192.168.168.122]) (127.0.0.1) (smtp-auth username cutting, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 May 2010 17:03:05 +0000 Message-ID: <4BDF01C8.6060901@apache.org> Date: Mon, 03 May 2010 10:03:04 -0700 From: Doug Cutting User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: avro-user@hadoop.apache.org Subject: Re: references to other schemas References: <93A14209-033A-4369-8E7D-6B3D585D23C1@richrelevance.com> In-Reply-To: <93A14209-033A-4369-8E7D-6B3D585D23C1@richrelevance.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Scott Carey wrote: > There has been talk that AvroGen would handle features like this (as well as many others) in time. However this is one that should probably be addressed at the JSON level regardless of the future direction of AvroGen. Note that JSON schemas and protocols need to be standalone, containing the full lexical closure of schemas referenced, when they are included in data files and exchanged in RPC handshakes without reference to external data. Thus I am reluctant to add a JSON syntax for file inclusion. Rather, I think a pre-processor is appropriate. The pre-processor would not be run on schemas included in files or exchanged in RPC handshakes, but would be run for schemas read from files. I have experimented with using the m4 pre-processor for this purpose, and found it a bit awkward. Perhaps someone can develop macros for m4 that make it palatable, or perhaps we can develop a custom pre-processor for JSON. We might exploit otherwise-illegal JSON syntax, like backquotes, for pre-processor directives. An include might look something like: {"protocol": "org.foo.BarProtocol", "types": [ `include org.foo.Bar`, ... ] } Also note that a protocol file (.avpr) need not actually define any messages but can be used to define a set of types that reference one another. This is a stopgap, but a useful one. Doug