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 61F04CD97 for ; Mon, 29 Jul 2013 12:47:16 +0000 (UTC) Received: (qmail 45827 invoked by uid 500); 29 Jul 2013 12:47:13 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 45745 invoked by uid 500); 29 Jul 2013 12:47:08 -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 45737 invoked by uid 99); 29 Jul 2013 12:47:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jul 2013 12:47:06 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of adriano@pert.com.ar designates 200.68.65.170 as permitted sender) Received: from [200.68.65.170] (HELO alerce1-mr.pert.com.ar) (200.68.65.170) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jul 2013 12:47:02 +0000 Received: from METEORO.pert.com.ar (192.168.1.36) by alerce1-mr.pert.com.ar id hupita19p8gq for ; Mon, 29 Jul 2013 09:53:19 -0300 (envelope-from ) Received: from METEORO.pert.com.ar ([fe80::11d6:548d:5e8:7182]) by METEORO.pert.com.ar ([fe80::11d6:548d:5e8:7182%10]) with mapi id 14.02.0247.003; Mon, 29 Jul 2013 09:46:38 -0300 From: Adriano Paggi To: "user@cassandra.apache.org" Subject: RE: AssertionError during ALTER TYPE in 1.2.5 Thread-Topic: AssertionError during ALTER TYPE in 1.2.5 Thread-Index: AQHOihfHx4dzZgF9kky1Q/vePBbo45l7h9oAgAATrSA= Date: Mon, 29 Jul 2013 12:46:37 +0000 Message-ID: <99B1330FDC371449BA02CAD8061EF1C463FE1E8A@METEORO.pert.com.ar> References: In-Reply-To: Accept-Language: es-AR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.1.227] Content-Type: multipart/alternative; boundary="_000_99B1330FDC371449BA02CAD8061EF1C463FE1E8AMETEOROpertcoma_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_99B1330FDC371449BA02CAD8061EF1C463FE1E8AMETEOROpertcoma_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Maybe it's because of the "COMPACT STORAGE". Without that, the cells of a C= QL3 table definition will be mapped to a composite taking the clustering pa= rt of the key and the column name. So, i.e. in your case the "value" column should be mapped to a cell with na= me column1:value if your def not includes the "COMPACT STORAGE" part. I thi= nk that the assert tries to ensure that the "alter" applies to a CQL3 table= (which column names are composite ones), and not the old "compact". http://www.datastax.com/dev/blog/thrift-to-cql3 Am I wrong? Adriano. ________________________________ From: aaron morton [mailto:aaron@thelastpickle.com] Sent: Lunes, 29 de Julio de 2013 05:23 a.m. To: user@cassandra.apache.org Subject: Re: AssertionError during ALTER TYPE in 1.2.5 The error is because the underlying CF is not defined using a composite typ= e for the comparator. CREATE TABLE "RRD" ( key text, column1 blob, value blob, PRIMARY KEY (key, column1) ) WITH COMPACT STORAGE AND Looks like this PRIMARY KEY (key, column1) is incorrect. That says "The Primary Key is made up of a Partition Key and one Clustering= Column. The Partition Key (storage engine row key) is the 'key' column. Th= e Clustering Column is 'column1'. The Clustering Column should be used as t= he first column in a composite type in the storage engine row for each non = Primary Key column name" But your CLI def does not use a composite type for the column validator. Try CREATE TABLE "RRD" ( key text, column1 blob, value blob, PRIMARY KEY (key) ) WITH COMPACT STORAGE AND Hope that helps. ----------------- Aaron Morton Cassandra Consultant New Zealand @aaronmorton http://www.thelastpickle.com On 27/07/2013, at 3:48 AM, Sergey Leschenko > wrote: Hi, I have following column family from pre-CQL times, now using 1.2.5 and want to investigate ability to use CQL instead of Thrift API. ColumnFamily: RRD Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type Default column value validator: org.apache.cassandra.db.marshal.BytesT= ype Columns sorted by: org.apache.cassandra.db.marshal.BytesType GC grace seconds: 864000 Compaction min/max thresholds: 4/32 Read repair chance: 0.1 DC Local Read repair chance: 0.0 Populate IO Cache on flush: false Replicate on write: true Caching: KEYS_ONLY Bloom Filter FP chance: default Built indexes: [] Compaction Strategy: org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy Compression Options: sstable_compression: org.apache.cassandra.io.compress.SnappyCompress= or In cqlsh it looks like CREATE TABLE "RRD" ( key text, column1 blob, value blob, PRIMARY KEY (key, column1) ) WITH COMPACT STORAGE AND bloom_filter_fp_chance=3D0.010000 AND caching=3D'KEYS_ONLY' AND comment=3D'' AND dclocal_read_repair_chance=3D0.000000 AND gc_grace_seconds=3D864000 AND read_repair_chance=3D0.100000 AND replicate_on_write=3D'true' AND populate_io_cache_on_flush=3D'false' AND compaction=3D{'class': 'SizeTieredCompactionStrategy'} AND compression=3D{'sstable_compression': 'SnappyCompressor'}; I have already successfully changed type of key from blob to text. column1 is actually a text string, as I would like to change it type from blob to text too. But when I run query ALTER TABLE "RRD" ALTER column1 TYPE text, cqlsh hangs, and I observe following error in Cassandra log: ERROR 18:28:56,103 Exception in thread Thread[Thrift:16,5,main] java.lang.AssertionError at org.apache.cassandra.cql3.statements.AlterTableStatement.ann= ounceMigration(AlterTableStatement.java:147) at org.apache.cassandra.cql3.statements.SchemaAlteringStatement= .execute(SchemaAlteringStatement.java:73) at org.apache.cassandra.cql3.QueryProcessor.processStatement(Qu= eryProcessor.java:132) at org.apache.cassandra.cql3.QueryProcessor.process(QueryProces= sor.java:143) at org.apache.cassandra.thrift.CassandraServer.execute_cql3_que= ry(CassandraServer.java:1707) at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3= _query.getResult(Cassandra.java:4074) at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3= _query.getResult(Cassandra.java:4062) at org.apache.thrift.ProcessFunction.process(ProcessFunction.ja= va:32) at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java= :34) at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerPr= ocess.run(CustomTThreadPoolServer.java:199) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool= Executor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo= lExecutor.java:615) at java.lang.Thread.run(Thread.java:724) >From source code I see that it failed assertion: case COLUMN_ALIAS: assert cfDef.isComposite; So it have to be composite, but there is already exists PRIMARY KEY (key, column1). Did I miss something? How can I change type of this column1 ? Thanks. -- Sergey --_000_99B1330FDC371449BA02CAD8061EF1C463FE1E8AMETEOROpertcoma_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Maybe it’s because of the “= ;COMPACT STORAGE”. Without that, the cells of a CQL3 table definition= will be mapped to a composite taking the clustering part of the key and the column name.

So, i.e. in your case the “value= ” column should be mapped to a cell with name column1:value if your d= ef not includes the “COMPACT STORAGE” part. I think that the assert tries to ensure that the “alter”= applies to a CQL3 table (which column names are composite ones), and not t= he old “compact”.

 

http://www.datastax.com/dev/blog/thrift-to-cql3

 

Am I wrong?

 

Adriano.

 


From: aaro= n morton [mailto:aaron@thelastpickle.com]
Sent: Lunes, 29 de Julio de = 2013 05:23 a.m.
To: user@cassandra.apache.org
Subject: Re: AssertionError = during ALTER TYPE in 1.2.5

 

The error is because the underlying CF is not defined using a compo= site type for the comparator. 

 

CREATE TABLE "RRD" (
 key text,
 column1 blob,
 value blob,
 PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE AND

Looks like this PRIMARY KEY (key, column1) is incorrect. =

 

That says "The Primary Key is made up of a Partition Key and o= ne Clustering Column. The Partition Key (storage engine row key) is the 'ke= y' column. The Clustering Column is 'column1'. The Clustering Column should be used as the first column in = a composite type in the storage engine row for each non Primary Key column = name"

 

But your CLI def does not use a composite type for the column valid= ator. 

 

Try

 

CREATE TABLE "RRD" (
 key text,
 column1 blob,
 value blob,
 PRIMARY KEY (key)
) WITH COMPACT STORAGE AND

 

Hope that helps. 

 

 

= --------= ---------

= Aaron Mo= rton

= Cassandr= a Consultant

New Zealand

= &nb= sp;

= @aaronmo= rton

 

On 27/07/2013, at 3:48 AM, Sergey Leschenko <sergle.ua@gmail.com> wrote:



Hi,
I have following column family from pre-CQL times, now using 1.2.5 and
want to investigate ability to use CQL instead of Thrift API.

  ColumnFamily: RRD
     Key Validation Class: org.apache.cassandra.db= .marshal.UTF8Type
     Default column value validator: org.apache.ca= ssandra.db.marshal.BytesType
     Columns sorted by: org.apache.cassandra.db.ma= rshal.BytesType
     GC grace seconds: 864000
     Compaction min/max thresholds: 4/32
     Read repair chance: 0.1
     DC Local Read repair chance: 0.0
     Populate IO Cache on flush: false
     Replicate on write: true
     Caching: KEYS_ONLY
     Bloom Filter FP chance: default
     Built indexes: []
     Compaction Strategy:
org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy
     Compression Options:
       sstable_compression: org.apache.c= assandra.io.compress.SnappyCompressor

In cqlsh it looks like

CREATE TABLE "RRD" (
 key text,
 column1 blob,
 value blob,
 PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE AND
 bloom_filter_fp_chance=3D0.010000 AND
 caching=3D'KEYS_ONLY' AND
 comment=3D'' AND
 dclocal_read_repair_chance=3D0.000000 AND
 gc_grace_seconds=3D864000 AND
 read_repair_chance=3D0.100000 AND
 replicate_on_write=3D'true' AND
 populate_io_cache_on_flush=3D'false' AND
 compaction=3D{'class': 'SizeTieredCompactionStrategy'} AND
 compression=3D{'sstable_compression': 'SnappyCompressor'};

I have already successfully changed type of key from blob to text.
column1 is actually a text string, as I would like to change it type
from blob to text too.

But when I run query  ALTER TABLE  "RRD" ALTER  co= lumn1  TYPE text,
cqlsh hangs, and I observe following error in Cassandra log:

ERROR 18:28:56,103 Exception in thread Thread[Thrift:16,5,main]
java.lang.AssertionError
       &n= bsp;    at org.apache.cassandra.cql3.statements.Alter= TableStatement.announceMigration(AlterTableStatement.java:147)
       &n= bsp;    at org.apache.cassandra.cql3.statements.Schem= aAlteringStatement.execute(SchemaAlteringStatement.java:73)
       &n= bsp;    at org.apache.cassandra.cql3.QueryProcessor.p= rocessStatement(QueryProcessor.java:132)
       &n= bsp;    at org.apache.cassandra.cql3.QueryProcessor.p= rocess(QueryProcessor.java:143)
       &n= bsp;    at org.apache.cassandra.thrift.CassandraServe= r.execute_cql3_query(CassandraServer.java:1707)
       &n= bsp;    at org.apache.cassandra.thrift.Cassandra$Proc= essor$execute_cql3_query.getResult(Cassandra.java:4074)
       &n= bsp;    at org.apache.cassandra.thrift.Cassandra$Proc= essor$execute_cql3_query.getResult(Cassandra.java:4062)
       &n= bsp;    at org.apache.thrift.ProcessFunction.process(= ProcessFunction.java:32)
       &n= bsp;    at org.apache.thrift.TBaseProcessor.process(T= BaseProcessor.java:34)
       &n= bsp;    at org.apache.cassandra.thrift.CustomTThreadP= oolServer$WorkerProcess.run(CustomTThreadPoolServer.java:199)
       &n= bsp;    at java.util.concurrent.ThreadPoolExecutor.ru= nWorker(ThreadPoolExecutor.java:1145)
       &n= bsp;    at java.util.concurrent.ThreadPoolExecutor$Wo= rker.run(ThreadPoolExecutor.java:615)
       &n= bsp;    at java.lang.Thread.run(Thread.java:724)

>From source code I see that it  failed assertion:
    case COLUMN_ALIAS:
            &nb= sp;     assert cfDef.isComposite;

So it have to be composite, but there is already exists PRIMARY KEY
(key, column1). Did I miss something?
How can I change type of this column1 ?

Thanks.

--
Sergey

 

--_000_99B1330FDC371449BA02CAD8061EF1C463FE1E8AMETEOROpertcoma_--