Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 35103 invoked from network); 25 Dec 2010 05:24:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Dec 2010 05:24:10 -0000 Received: (qmail 49391 invoked by uid 500); 25 Dec 2010 05:24:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 49127 invoked by uid 500); 25 Dec 2010 05:24:08 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 49119 invoked by uid 99); 25 Dec 2010 05:24:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Dec 2010 05:24:08 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.216.44] (HELO mail-qw0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Dec 2010 05:23:59 +0000 Received: by qwg5 with SMTP id 5so7673625qwg.31 for ; Fri, 24 Dec 2010 21:23:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.96.133 with SMTP id h5mr8813629qcn.147.1293254617534; Fri, 24 Dec 2010 21:23:37 -0800 (PST) Received: by 10.229.63.69 with HTTP; Fri, 24 Dec 2010 21:23:37 -0800 (PST) X-Originating-IP: [76.253.75.188] In-Reply-To: References: Date: Fri, 24 Dec 2010 23:23:37 -0600 Message-ID: Subject: Re: Newbie question - fetching multiple columns of different datatypes and conversion from byte[] From: Nate McCall To: hector-users@googlegroups.com Cc: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org In the case where you have different value types within the same slice, yes, you must handle the conversion yourself and ByteBufferSerializer is the easiest way to do that. On Fri, Dec 24, 2010 at 10:44 PM, Roshan Dawrani wrote: > Hi, > > I am new to Cassandra and Hector and have a basic question on fetching > multiple columns of a row that have mixed data types. > > So, I am basically doing equivalent of "Select dateCol1, dateCol2, > stringCol1, intCol1 from a_table where key in (?, ?, ?...)" > > My question is do I need to do the conversion of columns from byte[] to > Date/String/Int myself after taking out data from the ColumnSlice? > > For saving the same data, while adding the columns, I was able to tell which > serializer to use, but slice queries seem to take only one ValueSerializer > for all columns being retrieved. So, if I have got it correctly, I can only > use ByteBufferSerializer in the Hector API slice query call and then do > further data-type specific conversion myself at the app level? > > -- > Roshan > Blog: http://roshandawrani.wordpress.com/ > Twitter: @roshandawrani > Skype: roshandawrani >