Return-Path: X-Original-To: apmail-cassandra-dev-archive@www.apache.org Delivered-To: apmail-cassandra-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D1AC17DC9 for ; Fri, 30 Dec 2011 01:41:13 +0000 (UTC) Received: (qmail 27048 invoked by uid 500); 30 Dec 2011 01:41:12 -0000 Delivered-To: apmail-cassandra-dev-archive@cassandra.apache.org Received: (qmail 27005 invoked by uid 500); 30 Dec 2011 01:41:12 -0000 Mailing-List: contact dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list dev@cassandra.apache.org Received: (qmail 26997 invoked by uid 99); 30 Dec 2011 01:41:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Dec 2011 01:41:12 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.215.172 as permitted sender) Received: from [209.85.215.172] (HELO mail-ey0-f172.google.com) (209.85.215.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Dec 2011 01:41:07 +0000 Received: by eaak10 with SMTP id k10so7337099eaa.31 for ; Thu, 29 Dec 2011 17:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=inJseaiRVC/vLqLByZi3IWZeJ9t21PDdl/e6fFJVFY4=; b=OcVxxt7or9dVYCHJ01EUsn9iQYDrF0TmNAqiCnw/0hyVXFEICjleYsrtgn57V9EKU9 evQQEAuG52gy+Cci8HJpV44i51GJe5SPaKQddQxhMqEZQ7llRN0Ljzr97t9OTkystHwG 3cGdVggAHV1m+MXy025xMN8o7DIpyEbnaEVaw= Received: by 10.204.131.77 with SMTP id w13mr9390077bks.102.1325209246254; Thu, 29 Dec 2011 17:40:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.55.74 with HTTP; Thu, 29 Dec 2011 17:40:25 -0800 (PST) In-Reply-To: References: From: Jonathan Ellis Date: Thu, 29 Dec 2011 19:40:25 -0600 Message-ID: Subject: Re: CQL support for compound columns To: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable https://issues.apache.org/jira/browse/CASSANDRA-3685 On Thu, Dec 29, 2011 at 6:34 PM, Eric Evans wrote: > On Thu, Dec 29, 2011 at 3:44 PM, Jonathan Ellis wrote= : >> That's to allow defining column names that are not text/utf8. =A0So you >> could have column name "92d21d0a-d6cb-437c-9d3f-b67aa733a19f" be an >> actual 128-bit uuid binary value internally, not its string >> representation. =A0Put another way, this would affect the CqlMetadata >> name_types map. >> >> However, we already have the "column names are always strings" >> limitations with existing CQL DDL so it probably makes more sense to >> consider it separately from transposition. > > Right, and to get a jump on that bikeshedding I'd propose that look > something like: > > CREATE TABLE test ( > =A0 int(10) text, > =A0 uuid(92d21d0a-d6cb-437c-9d3f-b67aa733a19f) bigint > ) > > or... > > CREATE TABLE test ( > =A0 (int)10 text, > =A0 (uuid)92d21d0a-d6cb-437c-9d3f-b67aa733a19f bigint > ) > > But I digress, that's probably best left for another issue and another ti= me. :) > > >> On Thu, Dec 29, 2011 at 3:22 PM, Eric Evans wrote: >>> On Wed, Dec 28, 2011 at 1:05 PM, Jonathan Ellis wro= te: >>>> Gamma proposal update: >>>> >>>> The more I think about it the less happy I am with omitting support >>>> for sparse columns. =A0Remember that dense composites may only be >>>> inserted and deleted, not updated, since they are just a tuple of >>>> values with "column names" determined by schema and/or convention. >>>> >>>> I think we can support sparse columns well in a way that improves the >>>> conceptual integrity for the dense composites as well: >>>> >>>> {code} >>>> -- "column" and "value" are sparse; a transposed row will be stored as >>>> -- two columns of (user_id, posted_at, 'column': string) and (user_id, >>>> posted_at, 'value': blob) >>>> CREATE TABLE timeline ( >>>> =A0 user_id int, >>>> =A0 posted_at uuid, >>>> =A0 column string, >>>> =A0 value blob, >>>> =A0 PRIMARY KEY(user_id, posted_at) >>>> ) TRANSPOSED; >>>> >>>> -- entire transposed row is stored as a single dense composite column >>>> -- (series, ts1, cat, subcat, 1337, 92d21d0a-...: []). =A0Note that th= e >>>> -- composite column's value is unused in this case. >>>> CREATE TABLE events ( >>>> =A0 series text, >>>> =A0 ts1 int, >>>> =A0 cat text, >>>> =A0 subcat text, >>>> =A0 "1337" uuid, >>>> =A0 "92d21d0a-d6cb-437c-9d3f-b67aa733a19f" bigint, >>>> =A0 PRIMARY KEY(series, ts1, cat, subcat, "1337", >>>> "92d21d0a-d6cb-437c-9d3f-b67aa733a19f") >>>> ) TRANSPOSED WITH COLUMN NAMES ("1337" int, >>>> "92d21d0a-d6cb-437c-9d3f-b67aa733a19f" uuid); >>>> {code} >>> >>> Could you explain what this "TRANSPOSED WITH COLUMN NAMES" syntax does >>> (or link to a previous description if I missed it)? > > -- > Eric Evans > Acunu |=A0http://www.acunu.com=A0| @acunu --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com