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 095F710904 for ; Fri, 30 Aug 2013 18:01:59 +0000 (UTC) Received: (qmail 22531 invoked by uid 500); 30 Aug 2013 18:01:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 22488 invoked by uid 500); 30 Aug 2013 18:01:56 -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 22476 invoked by uid 99); 30 Aug 2013 18:01:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 18:01:55 +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 (athena.apache.org: domain of woolfel@gmail.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 18:01:51 +0000 Received: by mail-vc0-f172.google.com with SMTP id m17so1539613vca.31 for ; Fri, 30 Aug 2013 11:01:31 -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=Stj5Gtxr9TwD72mkT977XAlWm6WLEKdsFv4lzFeWf1o=; b=trnP5/Dsb3WsykfjwTJ8AjBO6jBvKZGIRsQ6mLilZl4kOKMb4FKmLvIsxc6yJ6BMYg Hwl8FGkyOW/aBOfVXNEPiVeQSoyoPCVQzn7UyRVsciYdLVQuIEbiVpJLsOrdpucUXr1M frv6RA4z4OfB4r17UDTCtL8whqnMTP6dSe3GlE/HADXvusCjKk1ZGfdFGHy6aSBfadnR 71a1Zo1GtfusfNQpGjJPfvXdHqZU+uilRIC5PF7wVktJBwq6/gFb7lJsH9NZmLCrBeS0 VfaYa5weQ1lhbA1MVxFzS8ShkgaNW8ZRlPONo/KOvZMUsfmTSO9nUxAxYrnF/m0jBmBm HKvA== MIME-Version: 1.0 X-Received: by 10.58.249.136 with SMTP id yu8mr5399vec.37.1377885690972; Fri, 30 Aug 2013 11:01:30 -0700 (PDT) Received: by 10.220.105.210 with HTTP; Fri, 30 Aug 2013 11:01:30 -0700 (PDT) In-Reply-To: References: <61E7EDCF-0F8D-4C4C-8D35-DF7808B24136@jonhaddad.com> Date: Fri, 30 Aug 2013 14:01:30 -0400 Message-ID: Subject: Re: CQL & Thrift From: Peter Lin To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b86f10226d18504e52e0308 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b86f10226d18504e52e0308 Content-Type: text/plain; charset=ISO-8859-1 I use dynamic columns all the time and they vary in type. With CQL you can define a default type, but you can't insert specific types of data for column name and value. It forces you to use all bytes or all strings, which would require coverting it to other types. thrift is much more powerful in that respect. not everyone needs to take advantage of the full power of dynamic columns. On Fri, Aug 30, 2013 at 1:58 PM, Jon Haddad wrote: > Just curious - what do you need to do that requires thrift? We've build > our entire platform using CQL3 and we haven't hit any issues. > > On Aug 30, 2013, at 10:53 AM, Peter Lin wrote: > > > 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 >> >> >> >> >> >> > > --047d7b86f10226d18504e52e0308 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

I use dynamic columns all the tim= e and they vary in type.

With CQL you can define a default type, but= you can't insert specific types of data for column name and value. It = forces you to use all bytes or all strings, which would require coverting i= t to other types.

thrift is much more powerful in that respect.

not ev= eryone needs to take advantage of the full power of dynamic columns.


On Fri, Au= g 30, 2013 at 1:58 PM, Jon Haddad <jon@jonhaddad.com> wrote:=
Jus= t curious - what do you need to do that requires thrift? =A0We've build= our entire platform using CQL3 and we haven't hit any issues. =A0

On Aug 30, 2013, at 10:53 AM, Peter Li= n <woolfel@gmail.= com> wrote:


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

CQL is too limiting and nega= tes 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 Mishra <mishra.vivs@gmail.co= m> 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








--047d7b86f10226d18504e52e0308--