Return-Path: Delivered-To: apmail-avro-user-archive@www.apache.org Received: (qmail 36868 invoked from network); 11 Mar 2011 04:05:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Mar 2011 04:05:28 -0000 Received: (qmail 70659 invoked by uid 500); 11 Mar 2011 04:05:27 -0000 Delivered-To: apmail-avro-user-archive@avro.apache.org Received: (qmail 70598 invoked by uid 500); 11 Mar 2011 04:05:27 -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 70590 invoked by uid 500); 11 Mar 2011 04:05:26 -0000 Delivered-To: apmail-hadoop-avro-user@hadoop.apache.org Received: (qmail 70587 invoked by uid 99); 11 Mar 2011 04:05:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 04:05:26 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=URI_HEX X-Spam-Check-By: apache.org Received-SPF: unknown (nike.apache.org: error in processing during lookup of Aleksey.Maslov@lab49.com) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2011 04:05:19 +0000 Received: from ben.nabble.com ([192.168.236.152]) by sam.nabble.com with esmtp (Exim 4.69) (envelope-from ) id 1Pxtb0-0002hm-Kt for avro-user@hadoop.apache.org; Thu, 10 Mar 2011 20:04:58 -0800 Date: Thu, 10 Mar 2011 20:04:58 -0800 (PST) From: Aleksey Maslov To: avro-user@hadoop.apache.org Message-ID: <1299816298641-2663512.post@n3.nabble.com> Subject: How to reference previously defined enum in avsc file? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, [i don't see my original post - but if you seen this already, I appologise for re-post] I am trying to define several objects in avsc files and compile the schema using avro-1.4.1; i have several questions; 1. Is it true that all objects MUST be defined in 1 huge file if I want to reference previously defined ones? (sounds a bit messy if you have dozens of objects to define, but ok); 2. I am having a problem defining a field of type enum (previously defined in same avsc file), with error: Exception in thread "main" org.apache.avro.SchemaParseException: "KnownLetters" is not a defined name. my avsc file contents: { "namespace": "def.al.pha.bet", "type": "enum", "name": "KnownLetters", "doc": "Specifies known types of letters", "symbols": ["A", "B", "C", "D", "E"], "namespace": "def.note.pad", "type": "record", "name": "Page", "doc": "Object definition of a Page composed of alphabet", "fields": [ {"name": "letter", "type": "KnownLetters"} ] } How could this be achived? What am i missing? 3. I am observing strange namespace related behavior; to experiment, in the above avsc definition I defined letter as "int" (just to keep going), and found that only 1 of the two objects are being generated (the Page.java); the enum is not generated at all, and i get no errors on the command line; why is that? my invocation is: > java -jar ..\lib\avro-tools-1.4.1.jar compile schema ..\def\test.avsc ..\ Thanks; -- View this message in context: http://apache-avro.679487.n3.nabble.com/How-to-reference-previously-defined-enum-in-avsc-file-tp2663512p2663512.html Sent from the Avro - Users mailing list archive at Nabble.com.