Return-Path: Delivered-To: apmail-hadoop-avro-dev-archive@minotaur.apache.org Received: (qmail 57209 invoked from network); 28 Apr 2010 07:32:56 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Apr 2010 07:32:56 -0000 Received: (qmail 31021 invoked by uid 500); 28 Apr 2010 07:32:56 -0000 Delivered-To: apmail-hadoop-avro-dev-archive@hadoop.apache.org Received: (qmail 30918 invoked by uid 500); 28 Apr 2010 07:32:55 -0000 Mailing-List: contact avro-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: avro-dev@hadoop.apache.org Delivered-To: mailing list avro-dev@hadoop.apache.org Received: (qmail 30910 invoked by uid 99); 28 Apr 2010 07:32:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Apr 2010 07:32:54 +0000 X-ASF-Spam-Status: No, hits=-1358.9 required=10.0 tests=ALL_TRUSTED,AWL 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; Wed, 28 Apr 2010 07:32:53 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3S7WXDB004517 for ; Wed, 28 Apr 2010 07:32:33 GMT Message-ID: <13504465.51471272439953745.JavaMail.jira@thor> Date: Wed, 28 Apr 2010 03:32:33 -0400 (EDT) From: "Jeff Hodges (JIRA)" To: avro-dev@hadoop.apache.org Subject: [jira] Created: (AVRO-530) allow for mutual recursion in type definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 allow for mutual recursion in type definitions ---------------------------------------------- Key: AVRO-530 URL: https://issues.apache.org/jira/browse/AVRO-530 Project: Avro Issue Type: Improvement Components: spec Affects Versions: 1.3.2 Reporter: Jeff Hodges Suppose you have these two types in your protocol: {code} {"name": "User", "type": "record", "fields": [{"name": "current_status", "type": "Status"}]} {"name": "Status", "type": "record", "fields": [{"name": "author", "type": "User"}]} {code} This will raise an error! The current workaround is to define one of them at their first usage. Like: {code} {"name": "User", "type": "record", "fields": [{"name": "current_status", "type": {"name": "Status", "type": "record", "fields": [.. lots of fields ...]}]} {code} But this is incredibly unwieldy. It would be really nice for the spec to require all the parsers to allow for mutual recursion, instead. It could be done by implementing a two-pass parser. One pass to acquire names referenced, and a second to fill in those names with their appropriate references. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.