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 C098F11E76 for ; Thu, 20 Feb 2014 17:47:28 +0000 (UTC) Received: (qmail 92987 invoked by uid 500); 20 Feb 2014 17:47:25 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 92935 invoked by uid 500); 20 Feb 2014 17:47:25 -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 92926 invoked by uid 99); 20 Feb 2014 17:47:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 17:47:25 +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: domain of sylvain@datastax.com designates 209.85.192.173 as permitted sender) Received: from [209.85.192.173] (HELO mail-pd0-f173.google.com) (209.85.192.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Feb 2014 17:47:18 +0000 Received: by mail-pd0-f173.google.com with SMTP id y10so2094512pdj.18 for ; Thu, 20 Feb 2014 09:46:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ojEbXWHgb7Q7olP3CkmVALBDHwtElysQcSMf7b3DhCU=; b=kaJGcTqW0vLvJfh7mwAYFP9Z0o25tWtLZaiXP6vpTvuGWvJS7aJxSNtXZEdirhQEXi yZPykSnGP3Y0opj8mD/wSE9t1EMZ3+SPfq62rlTPIcukp11WY0y2OKDsZbV9OqmhVh+f SOEqvIqKiHEMjuVeCn3JxJv+ndv70ga/qAMbRQ7NDWNYcVvjvQyKqk8wHYXNX2ON0GB3 O5IATAdy6o1UFgudB3C23cktaAVnGLhJ0Dz/j+rbnkHjN06ebIG7FE28J9eYU+zYoXWT mOG09LTaKB12BLl90JwrjZ3uxrmkMr2Fh/LHjZWhaPJvQnUy94ht3KAPZM/QkDuzfP82 T/ZA== X-Gm-Message-State: ALoCoQlHQxmXCb76KAMnnARXjK+1g0Tlm57FKLDwyMfmy1CL2XUYuBK3UrgAVA4CfmTSlgDTnx2k MIME-Version: 1.0 X-Received: by 10.67.12.171 with SMTP id er11mr3489736pad.123.1392918416687; Thu, 20 Feb 2014 09:46:56 -0800 (PST) Received: by 10.68.39.136 with HTTP; Thu, 20 Feb 2014 09:46:56 -0800 (PST) In-Reply-To: References: Date: Thu, 20 Feb 2014 18:46:56 +0100 Message-ID: Subject: Re: Performance problem with large wide row inserts using CQL From: Sylvain Lebresne To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=001a11331d6c6da34f04f2da170e X-Virus-Checked: Checked by ClamAV on apache.org --001a11331d6c6da34f04f2da170e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Feb 20, 2014 at 6:26 PM, Peter Lin wrote: > > I disagree with the sentiment that "thrift is not worth the trouble". > Way to quote only part of my sentence and get mental on it. My full sentence was "it's probably not worth the trouble to start with thrift if you're gonna use CQL later". > > CQL and all SQL inspired dialects limit one's ability to use arbitrary > typed data in dynamic columns. With thrift it's easy and straight forward= . > With CQL there is no way to tell Cassandra the type of the name and value > for a dynamic column. You can only set the default type. That means using= a > "pure cql" approach you can deviate from the default type. Cassandra will > throw an exception indicating the type is different than the default type= . > > Until such time that CQL abandons the shackles of SQL and adds the abilit= y > to indicate the column and value type. Something like this > > insert into myColumnFamily(staticColumn1, staticColumn2, 20 as int, > dynamicColumn as string) into ('text1','text2',30.55 as double, 3500 as > long) > > This is one area where Thrift is superior to CQL. Having said that, it's > valid to use Cassandra "as if" it was a relational database, but then you= 'd > miss out on some of the unique features. > Man, if I had a nickel every time someone came on that mailing list pretending that something was possible with thrift and not CQL ... I will claim this: with CASSANDRA-6561 and CASSANDRA-4851 that just got in, there is *nothing* that thrift can do that CQL cannot. But well, what do I know about Cassandra. -- Sylvain > > > > > On Thu, Feb 20, 2014 at 12:12 PM, Sylvain Lebresne = wrote: > >> On Thu, Feb 20, 2014 at 2:16 PM, Edward Capriolo = wrote: >> >>> For what it is worth you schema is simple and uses compact storage. Thu= s >>> you really dont need anything in cassandra 2.0 as far as i can tell. Yo= u >>> might be happier with a stable release like 1.2.something and just hect= or >>> or astyanax. You are really dealing with many issues you should not hav= e to >>> just to protoype a simple cassandra app. >> >> >> >> Of course, if everyone was using that reasoning, no-one would ever test >> new features and report problems/suggest improvement. So thanks to anyon= e >> like R=FCdiger that actually tries stuff and take the time to report pro= blems >> when they think they encounter one. Keep at it, *you* are the one helpin= g >> Cassandra to get better everyday. >> >> And you are also right R=FCdiger that it's probably not worth the troubl= e >> to start with thrift if you're gonna use CQL later. And you definitively >> should use CQL, it is Cassandra's future. >> >> -- >> Sylvain >> >> >> >>> >>> On Thursday, February 20, 2014, Sylvain Lebresne >>> wrote: >>> > >>> > >>> > >>> > On Wed, Feb 19, 2014 at 9:38 PM, R=FCdiger Klaehn >>> wrote: >>> >> >>> >> I have cloned the cassandra repo, applied the patch, and built it. >>> But when I want to run the bechmark I get an exception. See below. I tr= ied >>> with a non-managed dependency to >>> cassandra-driver-core-2.0.0-rc3-SNAPSHOT-jar-with-dependencies.jar, whi= ch I >>> compiled from source because I read that that might help. But that did = not >>> make a difference. >>> >> >>> >> So currently I don't know how to give the patch a try. Any ideas? >>> >> >>> >> cheers, >>> >> >>> >> R=FCdiger >>> >> >>> >> Exception in thread "main" java.lang.IllegalArgumentException: >>> replicate_on_write is not a column defined in this metadata >>> >> at >>> com.datastax.driver.core.ColumnDefinitions.getAllIdx(ColumnDefinitions.= java:273) >>> >> at >>> com.datastax.driver.core.ColumnDefinitions.getFirstIdx(ColumnDefinition= s.java:279) >>> >> at com.datastax.driver.core.Row.getBool(Row.java:117) >>> >> at >>> com.datastax.driver.core.TableMetadata$Options.(TableMetadata.jav= a:474) >>> >> at >>> com.datastax.driver.core.TableMetadata.build(TableMetadata.java:107) >>> >> at >>> com.datastax.driver.core.Metadata.buildTableMetadata(Metadata.java:128) >>> >> at >>> com.datastax.driver.core.Metadata.rebuildSchema(Metadata.java:89) >>> >> at >>> com.datastax.driver.core.ControlConnection.refreshSchema(ControlConnect= ion.java:259) >>> >> at >>> com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection= .java:214) >>> >> at >>> com.datastax.driver.core.ControlConnection.reconnectInternal(ControlCon= nection.java:161) >>> >> at >>> com.datastax.driver.core.ControlConnection.connect(ControlConnection.ja= va:77) >>> >> at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:89= 0) >>> >> at >>> com.datastax.driver.core.Cluster$Manager.newSession(Cluster.java:910) >>> >> at >>> com.datastax.driver.core.Cluster$Manager.access$200(Cluster.java:806) >>> >> at com.datastax.driver.core.Cluster.connect(Cluster.java:158) >>> >> at >>> cassandra.CassandraTestMinimized$delayedInit$body.apply(CassandraTestMi= nimized.scala:31) >>> >> at scala.Function0$class.apply$mcV$sp(Function0.scala:40) >>> >> at >>> scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12= ) >>> >> at scala.App$$anonfun$main$1.apply(App.scala:71) >>> >> at scala.App$$anonfun$main$1.apply(App.scala:71) >>> >> at scala.collection.immutable.List.foreach(List.scala:318) >>> >> at >>> scala.collection.generic.TraversableForwarder$class.foreach(Traversable= Forwarder.scala:32) >>> >> at scala.App$class.main(App.scala:71) >>> >> at >>> cassandra.CassandraTestMinimized$.main(CassandraTestMinimized.scala:5) >>> >> at >>> cassandra.CassandraTestMinimized.main(CassandraTestMinimized.scala) >>> > >>> > I believe you've tried the cassandra trunk branch? trunk is basically >>> the future Cassandra 2.1 and the driver is currently unhappy because th= e >>> replicate_on_write option has been removed in that version. I'm suppose= d to >>> have fixed that on the driver 2.0 branch like 2 days ago so maybe you'r= e >>> also using a slightly old version of the driver sources in there? Or ma= ybe >>> I've screwed up my fix, I'll double check. But anyway, it would be over= all >>> simpler to test with the cassandra-2.0 branch of Cassandra, with which = you >>> shouldn't run into that. >>> > -- >>> > Sylvain >>> >>> -- >>> Sorry this was sent from mobile. Will do less grammar and spell check >>> than usual. >>> >> >> > --001a11331d6c6da34f04f2da170e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On T= hu, Feb 20, 2014 at 6:26 PM, Peter Lin <woolfel@gmail.com> w= rote:

I disa= gree with the sentiment that "thrift is not worth the trouble".

Way to quote= only part of my sentence and get mental on it. My full sentence was "= it's probably not worth the trouble to start with thrift if you're = gonna use CQL later".
=A0

CQL and all SQL inspired dialects limit one's ability to use arbitra= ry typed data in dynamic columns. With thrift it's easy and straight fo= rward. With CQL there is no way to tell Cassandra the type of the name and = value for a dynamic column. You can only set the default type. That means u= sing a "pure cql" approach you can deviate from the default type.= Cassandra will throw an exception indicating the type is different than th= e default type.=A0
=

Until such time that CQL abandons the shackles of SQL and adds th= e ability to indicate the column and value type. Something like this
<= /div>

insert into myColumnFamily(staticColum= n1, staticColumn2, 20 as int, dynamicColumn as string) into ('text1'= ;,'text2',30.55 as double, 3500 as long)

This is one area where Thrift is superior to CQL. Having said tha= t, it's valid to use Cassandra "as if" it was a relational da= tabase, but then you'd miss out on some of the unique features.

Man, if I had a nickel every time so= meone came on that mailing list pretending that something was possible with= thrift and not CQL ... I will claim this: with=A0CASSANDRA-6561 and CASSAN= DRA-4851=A0that just got in, there is *nothing* that thrift can do that CQL= cannot. But well, what do I know about Cassandra.

--
Sylvain=A0

=A0


=

On Thu, Feb 20, 2014 at 12:12 PM, Sylvai= n Lebresne <sylvain@datastax.com> wrote:
On Thu, Feb 20, 2014 at 2:16 PM, Edward Capriolo <edlinuxguru@gmail.co= m> wrote:
For what it is= worth you schema is simple and uses compact storage. Thus you really dont = need anything in cassandra 2.0 as far as i can tell. You might be happier w= ith a stable release like 1.2.something and just hector or astyanax. You ar= e really dealing with many issues you should not have to just to protoype a= simple cassandra app.


Of course, if everyone was using t= hat reasoning, no-one would ever test new features and report problems/sugg= est improvement. So thanks to anyone like R=FCdiger that actually tries stu= ff and take the time to report problems when they think they encounter one.= Keep at it, *you* are the one helping Cassandra to get better everyday.=A0=

And you are also right=A0R=FCdiger that it's probab= ly not worth the trouble to start with thrift if you're gonna use CQL l= ater. And you definitively should use CQL, it is Cassandra's future.

--
Sylvain=A0

<= div>


On Thursday, February 20, 2014, Sylvain Lebresne <sylvain@datastax.com> wrote:=
>
>
>
> On Wed, Feb 19, 2014 at 9:38 PM, R=FCdiger= Klaehn <rklaehn@= gmail.com> wrote:
>>
>> I have cloned the cassandra repo, applied the patch, a= nd built it. But when I want to run the bechmark I get an exception. See be= low. I tried with a non-managed dependency to cassandra-driver-core-2.0.0-r= c3-SNAPSHOT-jar-with-dependencies.jar, which I compiled from source because= I read that that might help. But that did not make a difference.
>>
>> So currently I don't know how to give the patch a = try. Any ideas?
>>
>> cheers,
>>
>> R= =FCdiger
>>
>> Exception in thread "main" java.= lang.IllegalArgumentException: replicate_on_write is not a column defined i= n this metadata
>> =A0=A0=A0 at com.datastax.driver.core.ColumnDefinitions.getAllIdx(= ColumnDefinitions.java:273)
>> =A0=A0=A0 at com.datastax.driver.co= re.ColumnDefinitions.getFirstIdx(ColumnDefinitions.java:279)
>> = =A0=A0=A0 at com.datastax.driver.core.Row.getBool(Row.java:117)
>> =A0=A0=A0 at com.datastax.driver.core.TableMetadata$Options.<in= it>(TableMetadata.java:474)
>> =A0=A0=A0 at com.datastax.driver= .core.TableMetadata.build(TableMetadata.java:107)
>> =A0=A0=A0 at = com.datastax.driver.core.Metadata.buildTableMetadata(Metadata.java:128)
>> =A0=A0=A0 at com.datastax.driver.core.Metadata.rebuildSchema(Metad= ata.java:89)
>> =A0=A0=A0 at com.datastax.driver.core.ControlConne= ction.refreshSchema(ControlConnection.java:259)
>> =A0=A0=A0 at co= m.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:= 214)
>> =A0=A0=A0 at com.datastax.driver.core.ControlConnection.reconnectI= nternal(ControlConnection.java:161)
>> =A0=A0=A0 at com.datastax.d= river.core.ControlConnection.connect(ControlConnection.java:77)
>>= =A0=A0=A0 at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:89= 0)
>> =A0=A0=A0 at com.datastax.driver.core.Cluster$Manager.newSession(C= luster.java:910)
>> =A0=A0=A0 at com.datastax.driver.core.Cluster$= Manager.access$200(Cluster.java:806)
>> =A0=A0=A0 at com.datastax.= driver.core.Cluster.connect(Cluster.java:158)
>> =A0=A0=A0 at cassandra.CassandraTestMinimized$delayedInit$body.app= ly(CassandraTestMinimized.scala:31)
>> =A0=A0=A0 at scala.Function= 0$class.apply$mcV$sp(Function0.scala:40)
>> =A0=A0=A0 at scala.run= time.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
>> =A0=A0=A0 at scala.App$$anonfun$main$1.apply(App.scala:71)
>= > =A0=A0=A0 at scala.App$$anonfun$main$1.apply(App.scala:71)
>>= =A0=A0=A0 at scala.collection.immutable.List.foreach(List.scala:318)
&g= t;> =A0=A0=A0 at scala.collection.generic.TraversableForwarder$class.for= each(TraversableForwarder.scala:32)
>> =A0=A0=A0 at scala.App$class.main(App.scala:71)
>> =A0=A0= =A0 at cassandra.CassandraTestMinimized$.main(CassandraTestMinimized.scala:= 5)
>> =A0=A0=A0 at cassandra.CassandraTestMinimized.main(Cassandra= TestMinimized.scala)
>
> I believe you've tried the cassandra trunk branch? trunk i= s basically the future Cassandra 2.1 and the driver is currently unhappy be= cause the replicate_on_write option has been removed in that version. I'= ;m supposed to have fixed that on the driver 2.0 branch like 2 days ago so = maybe you're also using a slightly old version of the driver sources in= there? Or maybe I've screwed up my fix, I'll double check. But any= way, it would be overall simpler to test with the cassandra-2.0 branch of C= assandra, with which you shouldn't run into that.
> --
> Sylvain

--=
Sorry this was sent from mobile. Will do less grammar and spell check = than usual.



--001a11331d6c6da34f04f2da170e--