From user-return-34480-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Thu Jun 6 13:49:29 2013 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 D60E710DC3 for ; Thu, 6 Jun 2013 13:49:29 +0000 (UTC) Received: (qmail 91968 invoked by uid 500); 6 Jun 2013 13:49:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 91949 invoked by uid 500); 6 Jun 2013 13:49:27 -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 91932 invoked by uid 99); 6 Jun 2013 13:49:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 13:49:26 +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 bigjocker@gmail.com designates 209.85.161.179 as permitted sender) Received: from [209.85.161.179] (HELO mail-gg0-f179.google.com) (209.85.161.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Jun 2013 13:49:22 +0000 Received: by mail-gg0-f179.google.com with SMTP id c4so632547ggn.24 for ; Thu, 06 Jun 2013 06:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to:x-mailer; bh=0q3IcBx3QsHgJlETPrpofnK1FZKJAiwYiD70+OnQI3I=; b=ZjSNwfzU6Rj9O/obadgOllUj0cNwlOusDu78xhONQHIk5oRqQOhp+L3yO3zjTd6c4K PwqTgpU+a6FBh+lFKoNVb9hTBoyCrQyb1Z78+P1H1AW2a95BkmDWbGQ9acrP/Ckd2PWO MIL8cyozlE3HMZdHuZntfxc2vJqPmkrvr+4wNAeaLOQ4eejdLFJ05hZnSRbsesqWUqvx yt1muJ46cy1Yl4tlw7wjNgPRcAefR7sepkig/QYGpmBVW90Vxo8Vfjshm3ZmJVaWp8g/ 7aRlJB9wpd8tbiL7K07xMhbWa4fuJrxw6yF5s2MzSQizagFsGJkXFTt8FnCymvjVsZL1 5OUQ== X-Received: by 10.236.133.242 with SMTP id q78mr25966579yhi.78.1370526541797; Thu, 06 Jun 2013 06:49:01 -0700 (PDT) Received: from [192.168.1.100] ([200.8.76.117]) by mx.google.com with ESMTPSA id c67sm36913931yhc.22.2013.06.06.06.49.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Jun 2013 06:49:00 -0700 (PDT) From: Francisco Andrades Grassi Content-Type: multipart/alternative; boundary="Apple-Mail=_A2CC9936-E79F-4C97-B6F5-577A4072E9DB" Message-Id: <4142DE9E-B2C6-49D1-8E69-589F27D5305D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: Dynamic Columns Question Cassandra 1.2.5, Datastax Java Driver 1.0 Date: Thu, 6 Jun 2013 09:19:01 -0430 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1503) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_A2CC9936-E79F-4C97-B6F5-577A4072E9DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, CQL3 does now support dynamic columns. For tags or metadata values you = could use a Collection: http://www.datastax.com/dev/blog/cql3_collections For wide rows there's the enhanced primary keys, which I personally = prefer over the composite columns of yore: http://www.datastax.com/dev/blog/cql3-for-cassandra-experts http://thelastpickle.com/2013/01/11/primary-keys-in-cql/ -- Francisco Andrades Grassi www.bigjocker.com @bigjocker On Jun 6, 2013, at 8:32 AM, Joe Greenawalt = wrote: > Hi,=20 > I'm having some problems figuring out how to append a dynamic column = on a column family using the datastax java driver 1.0 and CQL3 on = Cassandra 1.2.5. Below is what i'm trying: >=20 > cqlsh:simplex> create table user (firstname text primary key, lastname = text); > cqlsh:simplex> insert into user (firstname, lastname) values = ('joe','shmoe'); > cqlsh:simplex> select * from user; >=20 > firstname | lastname > -----------+---------- > joe | shmoe >=20 > cqlsh:simplex> insert into user (firstname, lastname, middlename) = values ('joe','shmoe','lester'); > Bad Request: Unknown identifier middlename > cqlsh:simplex> insert into user (firstname, lastname, middlename) = values ('john','shmoe','lester'); > Bad Request: Unknown identifier middlename >=20 > I'm assuming you can do this based on previous based thrift based = clients like pycassa, and also by reading this: > The Cassandra data model is a dynamic schema, column-oriented data = model. This means that, unlike a relational database, you do not need to = model all of the columns required by your application up front, as each = row is not required to have the same set of columns. Columns and their = metadata can be added by your application as they are needed without = incurring downtime to your application. >=20 > here: http://www.datastax.com/docs/1.2/ddl/index >=20 > Is it a limitation of CQL3 and its connection vs. thrift?=20 > Or more likely i'm just doing something wrong? >=20 > Thanks, > Joe --Apple-Mail=_A2CC9936-E79F-4C97-B6F5-577A4072E9DB Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii Hi,

CQL3 does now support dynamic columns. For tags or metadata values you could use a Collection:


For wide rows there's the enhanced primary keys, which I personally prefer over the composite columns of yore:


--
Francisco Andrades Grassi
@bigjocker

On Jun 6, 2013, at 8:32 AM, Joe Greenawalt <joe.greenawalt@gmail.com> wrote:

Hi,
I'm having some problems figuring out how to append a dynamic column on a column family using the datastax java driver 1.0 and CQL3 on Cassandra 1.2.5.  Below is what i'm trying:

cqlsh:simplex> create table user (firstname text primary key, lastname text);
cqlsh:simplex> insert into user (firstname, lastname) values ('joe','shmoe');
cqlsh:simplex> select * from user;

 firstname | lastname
-----------+----------
       joe |    shmoe

cqlsh:simplex> insert into user (firstname, lastname, middlename) values ('joe','shmoe','lester');
Bad Request: Unknown identifier middlename
cqlsh:simplex> insert into user (firstname, lastname, middlename) values ('john','shmoe','lester');
Bad Request: Unknown identifier middlename


I'm assuming you can do this based on previous based thrift based clients like pycassa, and also by reading this:

The Cassandra data model is a dynamic schema, column-oriented data model. This means that, unlike a relational database, you do not need to model all of the columns required by your application up front, as each row is not required to have the same set of columns. Columns and their metadata can be added by your application as they are needed without incurring downtime to your application.

here: http://www.datastax.com/docs/1.2/ddl/index

Is it a limitation of CQL3 and its connection vs. thrift?
Or more likely i'm just doing something wrong?

Thanks,
Joe

--Apple-Mail=_A2CC9936-E79F-4C97-B6F5-577A4072E9DB--