Return-Path: Delivered-To: apmail-hadoop-avro-user-archive@minotaur.apache.org Received: (qmail 17746 invoked from network); 5 Apr 2010 21:29:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Apr 2010 21:29:00 -0000 Received: (qmail 85792 invoked by uid 500); 5 Apr 2010 21:29:00 -0000 Delivered-To: apmail-hadoop-avro-user-archive@hadoop.apache.org Received: (qmail 85759 invoked by uid 500); 5 Apr 2010 21:29:00 -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 85704 invoked by uid 99); 5 Apr 2010 21:29:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Apr 2010 21:29:00 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jhodges@twitter.com designates 209.85.223.203 as permitted sender) Received: from [209.85.223.203] (HELO mail-iw0-f203.google.com) (209.85.223.203) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Apr 2010 21:28:54 +0000 Received: by iwn41 with SMTP id 41so496652iwn.20 for ; Mon, 05 Apr 2010 14:28:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.205.199 with HTTP; Mon, 5 Apr 2010 14:28:32 -0700 (PDT) In-Reply-To: <35A67CDB-841B-48D5-B79E-4B7C46C64E46@richrelevance.com> References: <1270498675.74765915@192.168.2.228> <35A67CDB-841B-48D5-B79E-4B7C46C64E46@richrelevance.com> Date: Mon, 5 Apr 2010 14:28:32 -0700 Received: by 10.231.79.136 with SMTP id p8mr2934988ibk.4.1270502912789; Mon, 05 Apr 2010 14:28:32 -0700 (PDT) Message-ID: Subject: Re: Using 'bytes' as keys in a 'map' equivalent From: Jeff Hodges To: avro-user@hadoop.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org What languages are problematic? Would they also map the bytes type to the string type like ruby and python? -- Jeff On Mon, Apr 5, 2010 at 1:48 PM, Scott Carey wrote= : > For some other use cases, allowing all intrinsic simple types to be keys = would be useful in the future too. =A0 This would make Hive's schema system= map column type directly fit into Avro, for example. > > But as AVRO-9 points out, this would be problematic in many scripting lan= guages that only support string dictionaries. > > Complex types as keys is problematic and IMO should be avoided. > > Avro 2.0 perhaps? > > > In the meantime I'm serializing such data as an array of k,v tuples and t= he client object API deals with providing a map interface. =A0After all, th= at is all that a Map is in avro anyway, syntactic sugar around an array wit= h some type checking. > > -Scott > > On Apr 5, 2010, at 1:24 PM, Jeff Hodges wrote: > >> This would probably be of much benefit to the Cassandra community as >> they/we are working on getting their stored data to be keyed by byte >> arrays instead of String arrays[1]. Converting back and forth would >> less good. >> >> [1] Relevant ticket: https://issues.apache.org/jira/browse/CASSANDRA-767 >> -- >> Jeff >> >> On Mon, Apr 5, 2010 at 1:17 PM, Stu Hood wrote: >>> Hey gang, >>> >>> I can understand the reasoning behind AVRO-9, but now I need to look fo= r an alternative to a 'map' that will allow me to store an association of b= ytes keys to values. >>> >>> Is there a recommended pattern to store this structure, or is "list of = (key,value) tuples" the best option? >>> >>> Thanks much, >>> >>> Stu Hood >>> @stuhood >>> Architecture Software Developer >>> Email & Apps Division, Rackspace Hosting >>> >>> > >