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 DB48FC5D1 for ; Mon, 29 Jul 2013 08:23:53 +0000 (UTC) Received: (qmail 16111 invoked by uid 500); 29 Jul 2013 08:23:49 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 16080 invoked by uid 500); 29 Jul 2013 08:23:49 -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 16065 invoked by uid 99); 29 Jul 2013 08:23:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jul 2013 08:23:48 +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-a91.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jul 2013 08:23:41 +0000 Received: from homiemail-a91.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a91.g.dreamhost.com (Postfix) with ESMTP id 8B4E5AE075 for ; Mon, 29 Jul 2013 01:22:57 -0700 (PDT) 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=jcmTtoDBcG6lgtdKBrusEoylLK U=; b=XvD5LHQF/+whKLy1KT3Z/aAHAWFN/sGuT4TrBUkFeNdng6iX1zGYLM6Sb2 gyH05X7jjsV3Xda4SMKuY7fDgFBiz3BXgeMQaUbtryq73PPsj7Q0Jz2eM1ZXnZQj i1hHURWPL/VC5qZajYZ2IsFistBiB6ESLNcqvSKtBt42SwF80= Received: from [172.16.1.7] (unknown [203.86.207.101]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a91.g.dreamhost.com (Postfix) with ESMTPSA id D2840AE05B for ; Mon, 29 Jul 2013 01:22:56 -0700 (PDT) From: aaron morton Content-Type: multipart/alternative; boundary="Apple-Mail=_98390787-502D-4F98-AED0-675390FD4501" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: AssertionError during ALTER TYPE in 1.2.5 Date: Mon, 29 Jul 2013 20:23:16 +1200 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1508) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_98390787-502D-4F98-AED0-675390FD4501 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii The error is because the underlying CF is not defined using a composite = type for the comparator.=20 > 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.=20 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. 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 validator.=20= Try CREATE TABLE "RRD" ( key text, column1 blob, value blob, PRIMARY KEY (key) ) WITH COMPACT STORAGE AND Hope that helps.=20 =20 ----------------- 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. >=20 > ColumnFamily: RRD > Key Validation Class: org.apache.cassandra.db.marshal.UTF8Type > Default column value validator: = org.apache.cassandra.db.marshal.BytesType > 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.SnappyCompressor >=20 > In cqlsh it looks like >=20 > 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'}; >=20 > 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. >=20 > But when I run query ALTER TABLE "RRD" ALTER column1 TYPE text, > cqlsh hangs, and I observe following error in Cassandra log: >=20 > ERROR 18:28:56,103 Exception in thread Thread[Thrift:16,5,main] > java.lang.AssertionError > at = org.apache.cassandra.cql3.statements.AlterTableStatement.announceMigration= (AlterTableStatement.java:147) > at = org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(Schem= aAlteringStatement.java:73) > at = org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.j= ava:132) > at = org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:143) > at = org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraSe= rver.java:1707) > at = org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResu= lt(Cassandra.java:4074) > at = org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResu= lt(Cassandra.java:4062) > at = org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32) > at = org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) > at = org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(Cust= omTThreadPoolServer.java:199) > at = java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:= 1145) > at = java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java= :615) > at java.lang.Thread.run(Thread.java:724) >=20 > =46rom source code I see that it failed assertion: > case COLUMN_ALIAS: > assert cfDef.isComposite; >=20 > 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 ? >=20 > Thanks. >=20 > --=20 > Sergey --Apple-Mail=_98390787-502D-4F98-AED0-675390FD4501 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii The = error is because the underlying CF is not defined using a composite 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 one Clustering Column. The = Partition Key (storage engine row key) is the 'key' 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 = validator. 

Try

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

Hope that = helps. 

 
http://www.thelastpickle.com

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.cassandra.db.marshal.BytesType
=      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.SizeTieredCompactionStrate= gy
     Compression Options:
=        sstable_compression: = org.apache.cassandra.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  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.announceMigration= (AlterTableStatement.java:147)
at = org.apache.cassandra.cql3.statements.SchemaAlteringStatement.execute(Schem= aAlteringStatement.java:73)
at = org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.j= ava:132)
= at = org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:143)<= br> = at = org.apache.cassandra.thrift.CassandraServer.execute_cql3_query(CassandraSe= rver.java:1707)
at = org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResu= lt(Cassandra.java:4074)
at = org.apache.cassandra.thrift.Cassandra$Processor$execute_cql3_query.getResu= lt(Cassandra.java:4062)
at = org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
at = org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
at = org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(Cust= omTThreadPoolServer.java:199)
at = java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:= 1145)
= at = java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java= :615)
= at java.lang.Thread.run(Thread.java:724)

=46rom source = code I see that it  failed assertion:
=     case COLUMN_ALIAS:
=             &n= bsp;     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

= --Apple-Mail=_98390787-502D-4F98-AED0-675390FD4501--