Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD40BDF86 for ; Mon, 6 Aug 2012 07:16:21 +0000 (UTC) Received: (qmail 81088 invoked by uid 500); 6 Aug 2012 07:16:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 80779 invoked by uid 500); 6 Aug 2012 07:16:14 -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 80741 invoked by uid 99); 6 Aug 2012 07:16:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 07:16:12 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_HI,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Roshni.Rajagopal@wal-mart.com designates 161.168.202.15 as permitted sender) Received: from [161.168.202.15] (HELO PPES-Mail-N1.wal-mart.com) (161.168.202.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 07:16:07 +0000 Received: from pps.filterd (PPES-Mail-N1 [127.0.0.1]) by PPES-Mail-N1.wal-mart.com (8.14.4/8.14.4) with SMTP id q767Fb9L027163 for ; Mon, 6 Aug 2012 02:15:46 -0500 Received: from honts3517.homeoffice.wal-mart.com (walmart.com [161.168.202.1] (may be forged)) by PPES-Mail-N1.wal-mart.com with ESMTP id 16j8d5r8fx-1 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Mon, 06 Aug 2012 02:15:46 -0500 Received: from HONTS35018.homeoffice.Wal-Mart.com (172.27.184.35) by HONTS3517.homeoffice.Wal-Mart.com (161.166.40.181) with Microsoft SMTP Server (TLS) id 8.3.192.1; Mon, 6 Aug 2012 02:15:46 -0500 Received: from DCNTS3700us.homeoffice.Wal-Mart.com (172.29.104.83) by HONTS35018.homeoffice.Wal-Mart.com (172.27.184.35) with Microsoft SMTP Server (TLS) id 14.2.309.2; Mon, 6 Aug 2012 02:15:46 -0500 Received: from DCNTS3000XCHUS.homeoffice.Wal-Mart.com ([172.29.104.74]) by DCNTS3700us.homeoffice.Wal-Mart.com ([172.29.104.83]) with mapi; Mon, 6 Aug 2012 00:15:43 -0700 From: Roshni Rajagopal To: "user@cassandra.apache.org" Date: Mon, 6 Aug 2012 00:18:35 -0700 Subject: Re: Changing comparator Thread-Topic: Changing comparator Thread-Index: Ac1zo0oxN+e69jXGTb6jyQQpm2y+7Q== Message-ID: In-Reply-To: <501BBEB4.9070205@scandit.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.2.120421 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.260,0.0.0000 definitions=2012-08-06_02:2012-08-03,2012-08-06,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org Christof, Am not convinced you need to change your comparator. Bytestype works for most sorting even text ones. Did you mean validator- for a column's value. Comparator is for column ordering (ORDER BY in sql). I believe you can just convert the text you want to search for to bytes and then put it in where clause "Bytes type should just be done via BytesTypeSerializer (a no-op really) as a value " ... where value=3Draw bytes here" " Quoted from=20 https://groups.google.com/forum/?fromgroups#!topic/hector-users/BpaemK95sPo Disclaimer - I have not used this. It just seems an unnecessary thing to do - to convert your validator/comparator from the default BytesType. My understanding is that comparator for the column family can be BytesType unless you want a specific Order By like TimeUUID. And validators can be left as BytesType unless you want some specific validation that the value you are storing is a number or a time etc. Regards, Roshni On 03/08/12 5:36 PM, "Christof Roduner" wrote: >Hi Roshni, > >Thanks for your reply. As far as I know, ASSUME is only for cqlsh and >not for CQL in general. (We can of course achieve the same by >programmatically setting the encoding. It would be just simpler to let >the CQL driver take care of it...) > >Regards, >Christof > > >On 8/3/2012 11:31 AM, Roshni Rajagopal wrote: >> Christof , >> >> can't you just use ASSUME for the CQL session? >> >> http://www.datastax.com/docs/1.0/references/cql/ASSUME >> >> >> Regards, >> Roshni >> >> >> >> On 03/08/12 2:26 PM, "Christof Roduner" wrote: >> >>> Hi, >>> >>> I know that changing a CF's comparator is not officially supported. >>> However, there is a post by Jonathan Ellis that implies it can be done >>> (www.mail-archive.com/user@cassandra.apache.org/msg09502.html). >>> >>> I assume that we'd have to change entries in the system.schema_* column >>> families. >>> >>> Has anyone successfully done this? >>> >>> We want to change the comparator from BytesType to UTF8Type to make the >>> move to CQL easier ("cannot parse 'foo' as hex bytes"). Our CFs were >>> created back in the Cassandra 0.6.x days and are too large to be easily >>> copied to new CFs with a new schema. >>> >>> Many thanks in advance. >>> >>> Christof >> >> This email and any files transmitted with it are confidential and >>intended solely for the individual or entity to whom they are addressed. >>If you have received this email in error destroy it immediately. *** >>Walmart Confidential *** >> This email and any files transmitted with it are confidential and intended = solely for the individual or entity to whom they are addressed. If you have= received this email in error destroy it immediately. *** Walmart Confident= ial ***