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 97463E0FD for ; Sun, 25 Nov 2012 20:02:19 +0000 (UTC) Received: (qmail 25804 invoked by uid 500); 25 Nov 2012 20:02:17 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 25774 invoked by uid 500); 25 Nov 2012 20:02:17 -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 25765 invoked by uid 99); 25 Nov 2012 20:02:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Nov 2012 20:02:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a56.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Nov 2012 20:02:10 +0000 Received: from homiemail-a56.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a56.g.dreamhost.com (Postfix) with ESMTP id 0DE7AFE05B for ; Sun, 25 Nov 2012 12:01:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :content-type:message-id:mime-version:subject:date:references:to :in-reply-to; s=thelastpickle.com; bh=I+iAxlVNqpMsxA0Ob+1wCLGOJz U=; b=M+URCH8+W7WIWx9SGi4gQ84JCQQT0leqvXE9PEBdwE/tW8nTYZNqhJFQ2U hJhnYNjGND+AwFBc7ukcUeVQlPUhk+Erf+QIDipO40HoncYkXvtqfQl2cE4tq7Lh RsrlMCOifv+ivux+KCO+KW278h3+UHKyoO1Ht31aMnkVw1XZg= Received: from [192.168.2.13] (unknown [116.90.132.105]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a56.g.dreamhost.com (Postfix) with ESMTPSA id 8C5E5FE059 for ; Sun, 25 Nov 2012 12:01:28 -0800 (PST) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_67F04731-0AE5-4236-A32A-742C66E34CC6" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: Generic questions over Cassandra 1.1/1.2 Date: Mon, 26 Nov 2012 09:01:50 +1300 References: <9258885.272031353842472185.JavaMail.defaultUser@defaultHost> To: Cassandra User In-Reply-To: <9258885.272031353842472185.JavaMail.defaultUser@defaultHost> X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_67F04731-0AE5-4236-A32A-742C66E34CC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 > Now I am going to write a new application using cassandra so I started = reading=20 > documentation in order to "model" the new db using all the new = features and not=20 > reinventing the wheel. Some resources for CQL 3, it may match your needs. If not you can still = use Thrift through your favourite client... There have been a few articles on the DS blog = http://www.datastax.com/dev/blog A talk at the conference by Eric = http://www.datastax.com/events/cassandrasummit2012/presentations I did a webinar about it last month = http://www.datastax.com/resources/webinars/collegecredit > 1) SCF are deprecated and I see that what it used to be a development = concept=20 > (use a CF and build a row name using ROW+SC name, if you want keep = sorting use=20 > OPP) has become a Cassandra Concept (compund key). Yup (they have not been officially deprecated, it's just recommended = that you do not use them).=20 >=20 > SELECT * FROM ctable WHERE basekey =3D ? and myvalue =3D ? ORDER BY = extensionkey=20 > DESC LIMIT 5 > I haven't been able to do it =85. That looks ok, what was the error ?=20 What cassandra version and what CQL version? =20 > 2) Is Cassandra still schemaless? One thing I loved is that to create = a new=20 > column I didn't have to "alter" any cf before.=20 > Trying CQL 3 I noticed that if I try to make an insert of a new = "column" not=20 > defined in schema I raised an exception.=20 CQL 3 requires a schema, however altering the schema is easier. And in = 1.2 will support concurrent schema modifications.=20 Thrift API is still schema less.=20 Cheers ----------------- Aaron Morton Freelance Cassandra Developer New Zealand @aaronmorton http://www.thelastpickle.com On 26/11/2012, at 12:21 AM, cbertu81@libero.it wrote: > Hi all, > I'm in production with cassandra since version 0.6 then upgraded to = 0.7 and=20 > finally to 1.0. > If I look at my schema now it's "senseless" to be on 1.0 but many = things=20 > changed from 0.6 ... secondary indexes, counters, expiring columns and = more. > Now I am going to write a new application using cassandra so I started = reading=20 > documentation in order to "model" the new db using all the new = features and not=20 > reinventing the wheel. >=20 > So let's start with couple of questions ... sorry if stupid :-) >=20 > 1) SCF are deprecated and I see that what it used to be a development = concept=20 > (use a CF and build a row name using ROW+SC name, if you want keep = sorting use=20 > OPP) has become a Cassandra Concept (compund key). > Is it right? And more, can I avoid OPP when using compound keys since = inside=20 > partition key data are ordered on the remaining components of the = primary key? >=20 > finally I've tried to use the order by to sort data and it works -- = but can I=20 > use order by and where clause on a secondary index together?=20 >=20 > CREATE TABLE ctable ( > basekey uuid, > extensionkey uuid, > myvalue varchar, > PRIMARY KEY (basekey, extensionkey) > ) >=20 > SELECT * FROM ctable WHERE basekey =3D ? and myvalue =3D ? ORDER BY = extensionkey=20 > DESC LIMIT 5 > I haven't been able to do it .... >=20 > 2) Is Cassandra still schemaless? One thing I loved is that to create = a new=20 > column I didn't have to "alter" any cf before.=20 > Trying CQL 3 I noticed that if I try to make an insert of a new = "column" not=20 > defined in schema I raised an exception.=20 >=20 > Thanks in advance for any help >=20 > Carlo >=20 >=20 >=20 >=20 --Apple-Mail=_67F04731-0AE5-4236-A32A-742C66E34CC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Now I am going to write a new application = using cassandra so I started reading 
documentation in order to = "model" the new db using all the new features and = not 
reinventing the wheel.Some resources for CQL = 3, it may match your needs. If not you can still use Thrift through your = favourite client...

There have been a few articles on = the DS blog http://www.datastax.com/dev/blog=
=

<= div>
1) SCF are deprecated and I see that what = it used to be a development concept 
(use a CF and build a row = name using ROW+SC name, if you want keep sorting use 
OPP) has = become a Cassandra Concept (compund key).
Yup (they have not = been officially deprecated, it's just recommended that you do not use = them). 


SELECT * FROM = ctable WHERE basekey =3D ?  and myvalue =3D ? ORDER BY = extensionkey 
DESC LIMIT 5
I haven't been able to do it = =85.
That looks ok, what was the error = ? 
What cassandra version and what CQL = version?
 
2) Is = Cassandra still schemaless? One thing I loved is that to create a = new 
column I didn't have to "alter" any cf = before. 
Trying CQL 3 I noticed that if I try to make an insert = of a new "column" not 
defined in schema I raised an = exception. 
CQL 3 requires a schema, however = altering the schema is easier. And in 1.2 will support concurrent schema = modifications. 
Thrift API is still schema = less. 

Cheers

http://www.thelastpickle.com

On 26/11/2012, at 12:21 AM, cbertu81@libero.it = wrote:

Hi all,
I'm in production with cassandra since version = 0.6 then upgraded to 0.7 and
finally to 1.0.
If I look at my = schema now it's "senseless" to be on 1.0 but many things
changed = from 0.6 ... secondary indexes, counters, expiring columns and = more.
Now I am going to write a new application using cassandra so I = started reading
documentation in order to "model" the new db using = all the new features and not
reinventing the wheel.

So let's = start with couple of questions ... sorry if stupid :-)

1) SCF are = deprecated and I see that what it used to be a development concept =
(use a CF and build a row name using ROW+SC name, if you want keep = sorting use
OPP) has become a Cassandra Concept (compund key).
Is = it right? And more, can I avoid OPP when using compound keys since = inside
partition key data are ordered on the remaining components of = the primary key?

finally  I've tried to use the order by to = sort data and it works -- but can I
use order by and where clause on = a secondary index together?

CREATE TABLE ctable (
=    basekey uuid,
   extensionkey = uuid,
   myvalue varchar,
=    PRIMARY KEY (basekey, extensionkey)
)

= SELECT * FROM ctable WHERE basekey =3D ?  and myvalue =3D ? ORDER = BY extensionkey
DESC LIMIT 5
I haven't been able to do it = ....

2) Is Cassandra still schemaless? One thing I loved is that = to create a new
column I didn't have to "alter" any cf before. =
Trying CQL 3 I noticed that if I try to make an insert of a new = "column" not
defined in schema I raised an exception.

Thanks = in advance for any = help

Carlo





<= /html>= --Apple-Mail=_67F04731-0AE5-4236-A32A-742C66E34CC6--