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 25282108D8 for ; Fri, 30 Aug 2013 17:54:24 +0000 (UTC) Received: (qmail 3770 invoked by uid 500); 30 Aug 2013 17:54:21 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 3750 invoked by uid 500); 30 Aug 2013 17:54:21 -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 3742 invoked by uid 99); 30 Aug 2013 17:54:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 17:54:20 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of woolfel@gmail.com designates 209.85.220.178 as permitted sender) Received: from [209.85.220.178] (HELO mail-vc0-f178.google.com) (209.85.220.178) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 17:54:14 +0000 Received: by mail-vc0-f178.google.com with SMTP id ha12so1505364vcb.23 for ; Fri, 30 Aug 2013 10:53:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=URhm+TgL4l814C1q43rwP1Nc7aIqmdvD6S3XNVFkL2M=; b=DNwvun3PQPap13p26X6IJwyNjAS3uk9vq9ngrKl+XbFaiAtF076s1P+gNdXUoNYATA UOHtoTWbpHWeKgY4EiTaDLVN2j3JVtnl9GiqO0wpCRsrLvMvG68Bx2t/iET0oeKQ+j2y zARWjpKMH66ZfSz8x56k6kf1/UIJtS8ninSm6x34Geb3h8j8wQhAUjE40lP20hOX7lPh KG+3gUEuNxx4SS4JLc+qAMNr/g092M5+dxyNO/qy8CaVaP1z7ZzmgkRYCekzaheSDKgH YU7cEPM6Cb+3bJlZOdGITSygr1j3fRzA0BX0iEi6X89UimZxwCJQ3k2LAP2G73pS8elB 5/Yg== MIME-Version: 1.0 X-Received: by 10.52.73.162 with SMTP id m2mr7268215vdv.24.1377885234100; Fri, 30 Aug 2013 10:53:54 -0700 (PDT) Received: by 10.220.105.210 with HTTP; Fri, 30 Aug 2013 10:53:54 -0700 (PDT) In-Reply-To: <61E7EDCF-0F8D-4C4C-8D35-DF7808B24136@jonhaddad.com> References: <61E7EDCF-0F8D-4C4C-8D35-DF7808B24136@jonhaddad.com> Date: Fri, 30 Aug 2013 13:53:54 -0400 Message-ID: Subject: Re: CQL & Thrift From: Peter Lin To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec5016229eb7ff904e52de7db X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5016229eb7ff904e52de7db Content-Type: text/plain; charset=ISO-8859-1 my bias perspective, I find the sweet spot is thrift for insert/update and CQL for select queries. CQL is too limiting and negates the power of storing arbitrary data types in dynamic columns. On Fri, Aug 30, 2013 at 1:45 PM, Jon Haddad wrote: > If you're going to work with CQL, work with CQL. If you're going to work > with Thrift, work with Thrift. Don't mix. > > On Aug 30, 2013, at 10:38 AM, Vivek Mishra wrote: > > Hi, > If i a create a table with CQL3 as > > create table user(user_id text PRIMARY KEY, first_name text, last_name > text, emailid text); > > and create index as: > create index on user(first_name); > > then inserted some data as: > insert into user(user_id,first_name,last_name,"emailId") > values('@mevivs','vivek','mishra','vivek.mishra@impetus.co.in'); > > > Then if update same column family using Cassandra-cli as: > > update column family user with key_validation_class='UTF8Type' and > column_metadata=[{column_name:last_name, validation_class:'UTF8Type', > index_type:KEYS},{column_name:first_name, validation_class:'UTF8Type', > index_type:KEYS}]; > > > Now if i connect via cqlsh and explore user table, i can see column > first_name,last_name are not part of table structure anymore. Here is the > output: > > CREATE TABLE user ( > key text PRIMARY KEY > ) WITH > bloom_filter_fp_chance=0.010000 AND > caching='KEYS_ONLY' AND > comment='' AND > dclocal_read_repair_chance=0.000000 AND > gc_grace_seconds=864000 AND > read_repair_chance=0.100000 AND > replicate_on_write='true' AND > populate_io_cache_on_flush='false' AND > compaction={'class': 'SizeTieredCompactionStrategy'} AND > compression={'sstable_compression': 'SnappyCompressor'}; > > cqlsh:cql3usage> select * from user; > > user_id > --------- > @mevivs > > > > > > I understand that, CQL3 and thrift interoperability is an issue. But this > looks to me a very basic scenario. > > > > Any suggestions? Or If anybody can explain a reason behind this? > > -Vivek > > > > > > --bcaec5016229eb7ff904e52de7db Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

my bias perspective, I find the sweet = spot is thrift for insert/update and CQL for select queries.

C= QL is too limiting and negates the power of storing arbitrary data types in= dynamic columns.


On Fri,= Aug 30, 2013 at 1:45 PM, Jon Haddad <jon@jonhaddad.com> wro= te:
If = you're going to work with CQL, work with CQL. =A0If you're going to= work with Thrift, work with Thrift. =A0Don't mix.

On Aug 30, 2013, at 10:38 AM, Vivek Mi= shra <mishra.= vivs@gmail.com> wrote:

Hi,
If i a create a table with CQL3 as=A0

create table user(user_id text PRIMARY KEY, first_name text, last_name tex= t, emailid text);

and create index as:
create index on user(first_name);
=

then inserted some data as:
insert into user(= user_id,first_name,last_name,"emailId") values('@mevivs',= 'vivek','mishra','vivek.mishra@impetus.co.in');


Then if update same column family = using Cassandra-cli as:

update column family user = with key_validation_class=3D'UTF8Type' and column_metadata=3D[{colu= mn_name:last_name, validation_class:'UTF8Type', index_type:KEYS},{c= olumn_name:first_name, validation_class:'UTF8Type', index_type:KEYS= }];


Now if i connect via cqlsh and exp= lore user table, i can see column first_name,last_name are not part of tabl= e structure anymore. Here is the output:

CREATE TABLE user (
=A0 key text PRIMARY KEY<= /div>
) WITH
=A0 bloom_filter_fp_chance=3D0.010000 AND
<= div>=A0 caching=3D'KEYS_ONLY' AND
=A0 comment=3D''= ; AND
=A0 dclocal_read_repair_chance=3D0.000000 AND
=A0 gc_grace_s= econds=3D864000 AND
=A0 read_repair_chance=3D0.100000 AND
=A0 replicate_on_write=3D'true' AND
=A0 populate_io_ca= che_on_flush=3D'false' AND
=A0 compaction=3D{'class': 'SizeTieredCompactionStrategy&#= 39;} AND
=A0 compression=3D{'sstable_compression': 'S= nappyCompressor'};

cqlsh:cql3usage> select = * from user;

=A0user_id
---------
=A0@mevivs




I understand that, CQL3 and thrift interoperability is an issu= e. But this looks to me a very basic scenario.



Any suggestions? Or If an= ybody can explain a reason behind this?

-Vivek






--bcaec5016229eb7ff904e52de7db--