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 7A95B10956 for ; Wed, 31 Jul 2013 12:23:39 +0000 (UTC) Received: (qmail 10967 invoked by uid 500); 31 Jul 2013 12:23:37 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 10720 invoked by uid 500); 31 Jul 2013 12:23:37 -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 10712 invoked by uid 99); 31 Jul 2013 12:23:36 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 12:23:36 +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 arodrime@gmail.com designates 209.85.215.46 as permitted sender) Received: from [209.85.215.46] (HELO mail-la0-f46.google.com) (209.85.215.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 12:23:32 +0000 Received: by mail-la0-f46.google.com with SMTP id eh20so447751lab.19 for ; Wed, 31 Jul 2013 05:23:11 -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=8tqC/yOJXpoWCHPWTr4LOg5AdQAz2C7dPLH7K+7ocU4=; b=0Go6QX1OTGnaiIyp7sTP2DPyGp6rDaS+2NjgxRAYWaDGHkqg3HbzfIAWf07YidNtbB cEJ7iI0799MGdbNiBhF+ohTBhLGKsvcfj85N/LOWj3w1GiFjLIk9t1c1KuYQTQwrgETZ f1Q9eJ0J38d7x3xCaiV2iCeUouA1p7Xd0aXFOE/zTU1NldI463J89JqS9jXfLKLCNf+O O3rxXHzVxXD+kz94TDOcn7QofXfdlicjZ2+Wee39l5CVcAm+UBA8BghpuQp6TujL03jN JbrAOsdmS9gd055bpw0KI+zKwAUFmspvd7V+msnXa5vDj0w/b+HMjCqFC2fa4OD8UtS8 6PRA== X-Received: by 10.152.22.198 with SMTP id g6mr8197839laf.5.1375273391189; Wed, 31 Jul 2013 05:23:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.150.161 with HTTP; Wed, 31 Jul 2013 05:22:51 -0700 (PDT) In-Reply-To: References: <20130731104703.GG1764@snowy.squish.net> From: Alain RODRIGUEZ Date: Wed, 31 Jul 2013 14:22:51 +0200 Message-ID: Subject: Re: CQL and undefined columns To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e0160bab0f374ec04e2cdc984 X-Virus-Checked: Checked by ClamAV on apache.org --089e0160bab0f374ec04e2cdc984 Content-Type: text/plain; charset=ISO-8859-1 Oops, sorry about double post. Alain 2013/7/31 Alain RODRIGUEZ > I like to point to this article from Sylvain, which is really well written. > > http://www.datastax.com/dev/blog/thrift-to-cql3 > > It explains a lot of things and is really interesting for Cassandra users > pre-CQL3. > > Actually, old dynamic columns were defined this way : > > CREATE TABLE test ( > key text, > column1 text, > value text, > PRIMARY KEY (key, column1) > ) WITH COMPACT STORAGE; > > This is still doable with CQL3, column1 would be your column name, value, > the value of your column. As the primary key is composed by key + column1, > you can add as much columns as you want. > > An other way to do it is to dynamically add columns (Alter table ..., > afaik, this is lock free and does not slow performance too much). > > > 2013/7/31 Jon Ribbens > >> I thought that part of the point of Cassandra was that, unlike a >> standard relational database, each row does not have to have the same >> set of columns. I don't understand how this squares with CQL. If I want >> to have a table ("column family"?) with a few fixed columns that are >> relevant to every row, I can create that with CQL's CREATE TABLE, but >> if I then want to set extra columns with arbitrary names on various >> rows, how do I tell CQL what type those columns are? Or is this >> feature of Cassandra now deprecated? >> > > --089e0160bab0f374ec04e2cdc984 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Oops, sorry about double post.

Alain


2013= /7/31 Alain RODRIGUEZ <arodrime@gmail.com>
I like to point to this art= icle from Sylvain, which is really well written.


It explains a lot of things and is really interes= ting for Cassandra users pre-CQL3.

Actually, old d= ynamic columns were defined this way :

CREATE= TABLE test (
=A0 key =A0 =A0 =A0 =A0 =A0 =A0text,
=A0 column1 =A0 =A0 tex= t,
=A0 value =A0 =A0 =A0 =A0 =A0text,
=A0 PRIMARY KEY (= key,=A0column1)
) WITH COMPACT STORAGE;

This is still doable with CQL3, column1 would be your column name, va= lue, the value of your column. As the primary key is composed by key + colu= mn1, you can add as much columns as you want.=A0

An other way to do it is to dynamically add columns (Al= ter table ..., afaik, this is lock free and does not slow performance too m= uch).=A0


2013/7/31 Jon Ribbens <jon-cassandra@unequivocal.co.uk&g= t;
I thought that part of the point of Cassandra was that, unlike a
standard relational database, each row does not have to have the same
set of columns. I don't understand how this squares with CQL. If I want=
to have a table ("column family"?) with a few fixed columns that = are
relevant to every row, I can create that with CQL's CREATE TABLE, but if I then want to set extra columns with arbitrary names on various
rows, how do I tell CQL what type those columns are? Or is this
feature of Cassandra now deprecated?


--089e0160bab0f374ec04e2cdc984--