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 1506A109B3 for ; Fri, 30 Aug 2013 18:19:21 +0000 (UTC) Received: (qmail 72064 invoked by uid 500); 30 Aug 2013 18:19:18 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 72043 invoked by uid 500); 30 Aug 2013 18:19:18 -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 72035 invoked by uid 99); 30 Aug 2013 18:19:18 -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 18:19:18 +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 jbellis@gmail.com designates 74.125.82.48 as permitted sender) Received: from [74.125.82.48] (HELO mail-wg0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Aug 2013 18:19:12 +0000 Received: by mail-wg0-f48.google.com with SMTP id c11so1883170wgh.15 for ; Fri, 30 Aug 2013 11:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=gwS0WewNQBQdz8aTeI/NUB0CpgK76vJ7u78Lr3N443Y=; b=rbOcWDBlpYqcvIRDYagreQytsX4WAr6bUrRG29/6kzfjFVDjZBwMbpIW9TpOcOuFBA IyIwIkIxe8srnS25O0dqwk9qyfLzcyBi/XVTixmZMzd7HUgYeLQ08rUsVaOjqcfbfhJj PkdXbBK/QsOphcG6RWsLRlfmUeqPkgqFzeyvyKF9T4nMJrUX0N+mYQbMhfYokfyZNuuc DIcMOl4Km7LUzBYKpP9Qh3RpWDA8+1kbfGmT61gglZ9qMg93h3M3NBb+5aPu1zAptNwr +cpxiyHusoMTwt+STUJ3dLXATsgG/7NkVN/GVzw4Z587r4nciVJtn7MFBuXgQgPHIKHD LONQ== X-Received: by 10.181.11.230 with SMTP id el6mr3542417wid.8.1377886732156; Fri, 30 Aug 2013 11:18:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.17.67 with HTTP; Fri, 30 Aug 2013 11:18:32 -0700 (PDT) In-Reply-To: References: <61E7EDCF-0F8D-4C4C-8D35-DF7808B24136@jonhaddad.com> From: Jonathan Ellis Date: Fri, 30 Aug 2013 13:18:32 -0500 Message-ID: Subject: Re: CQL & Thrift To: user Content-Type: multipart/alternative; boundary=f46d043c802c3604a604e52e411a X-Virus-Checked: Checked by ClamAV on apache.org --f46d043c802c3604a604e52e411a Content-Type: text/plain; charset=ISO-8859-1 http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows On Fri, Aug 30, 2013 at 12:53 PM, 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 >> >> >> >> >> >> > -- Jonathan Ellis Project Chair, Apache Cassandra co-founder, http://www.datastax.com @spyced --f46d043c802c3604a604e52e411a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

=
On Fri, Aug 30, 2013 at 12:53 PM, Peter Lin <wo= olfel@gmail.com> wrote:

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 Hadda= d <jon@jonhaddad.com> wrote:
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









--
Jonathan El= lis
Project Chair, Apache Cassandra
co-founder, http://www.datastax.com
@spyced
--f46d043c802c3604a604e52e411a--