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 228F0D1C3 for ; Tue, 9 Oct 2012 08:53:01 +0000 (UTC) Received: (qmail 21189 invoked by uid 500); 9 Oct 2012 08:52:58 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 21169 invoked by uid 500); 9 Oct 2012 08:52:58 -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 21161 invoked by uid 99); 9 Oct 2012 08:52:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 08:52:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mishra.vivs@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pb0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 08:52:51 +0000 Received: by mail-pb0-f44.google.com with SMTP id ro8so5003438pbb.31 for ; Tue, 09 Oct 2012 01:52:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=CP7SxrGhzoRfeU9maF7I/Cg0yV0tIkDJmHflJ6TVNJo=; b=MgR3k6Ma0pqHbg7xpNyR0BYk9XUqHEvBACVQor7UIe9v85dAeE1H7Y1MrVqp6oAbsT /JrvCt3ge/GrKpQ4H6GHOO2f6cTDDZxJ6ify5pqS6Sh34K53Iv/BQdgyLnry3yFCP/ay jbomROSOiMG++3X2QKH2vl8YEJA3QRMqRD68yehLmh4Af1drPTYU/0dmfd1tJ30VRY4U x7CvEfJIeb/dpzz+3Oege8crVe8WTYKe5g1jyUBLqin9slLPWMOyfvbl4k+1GOGoaAcn fiJb88lzlJOV2P84+ZNLU5u00lqp8ppwIHFvhLo0FS+ok6ZnWU/I8nIFEdhCymdndZlS ji1A== MIME-Version: 1.0 Received: by 10.68.225.199 with SMTP id rm7mr61974318pbc.150.1349772749989; Tue, 09 Oct 2012 01:52:29 -0700 (PDT) Received: by 10.66.10.71 with HTTP; Tue, 9 Oct 2012 01:52:29 -0700 (PDT) In-Reply-To: References: <17C39FE466076C46B6E83F129C7B19CE16B8B5B5@HKXPRD0310MB352.apcprd03.prod.outlook.com> Date: Tue, 9 Oct 2012 14:22:29 +0530 Message-ID: Subject: Re: Using compound primary key From: Vivek Mishra To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b10cc6b4a679d04cb9c7550 --047d7b10cc6b4a679d04cb9c7550 Content-Type: text/plain; charset=ISO-8859-1 1 strange issue with 1.1.5 . It works with CQL3: **************************************************************************************************************************************************8 CREATE TABLE altercations ( ... instigator text, ... started_at timestamp, ... ships_destroyed int, ... energy_used float, ... alliance_involvement boolean, ... PRIMARY KEY (instigator,started_at) ... ); cqlsh:testcomp> drop columnfamily altercations; cqlsh:testcomp> CREATE TABLE altercations ( ... instigator text, ... started_at timestamp, ... ships_destroyed int, ... energy_used float, ... alliance_involvement boolean, ... PRIMARY KEY (instigator,started_at,ships_destroyed) ... ); cqlsh:testcomp> INSERT INTO altercations (instigator, started_at, ships_destroyed, ... energy_used, alliance_involvement) ... VALUES ('Jayne Cobb', '2012-07-23', 2, 4.6, 'false'); cqlsh:testcomp> select * from altercations; instigator | started_at | ships_destroyed | alliance_involvement | energy_used ------------+--------------------------+-----------------+----------------------+------------- Jayne Cobb | 2012-07-23 00:00:00+0000 | 2 | False | 4.6 **************************************************************************************************************************************************8 But after this when i try with cassandra-cli (to fetch this record): [default@testcomp] list altercations; Using default limit of 100 Using default column limit of 100 ------------------- RowKey: Jayne Cobb => (column=2012-07-23 00:00:00+0530:2:alliance_involvement, value=, timestamp=1349772570037000) invalid UTF8 bytes 40933333 gives me {invalid UTF8 bytes 40933333} Not sure, whether it will behave in same way if i go with thrift java client? Is this a problem CQL or thrift API? -Vivek On Tue, Oct 9, 2012 at 2:14 PM, Vivek Mishra wrote: > Works fine with 1.1.5 > > Thanks, > -Vivek > > > On Tue, Oct 9, 2012 at 1:59 PM, Vivek Mishra wrote: > >> I am going to try it on 1.1.5 >> >> In case if you can point me to changes made in between since 1.1.2 to >> 1.1.5 . It will be great. >> >> -Vivek >> >> >> On Tue, Oct 9, 2012 at 1:51 PM, Sylvain Lebresne wrote: >> >>> On Tue, Oct 9, 2012 at 9:50 AM, Vivek Mishra >>> wrote: >>> > Unfortunately nothing in server logs leads me to any error. >>> >>> Ok. Would you mind checking if you can reproduce against 1.1.5 if you >>> haven't already. If it does, do you mind opening a JIRA ticket with >>> the steps to reproduce? >>> >>> Thanks, >>> Sylvain >>> >>> > >>> > -Vivek >>> > >>> > >>> > On Tue, Oct 9, 2012 at 1:16 PM, Sylvain Lebresne >> > >>> > wrote: >>> >> >>> >> On Tue, Oct 9, 2012 at 8:57 AM, Vivek Mishra >>> >> wrote: >>> >> > Ok. I am able to understand the problem now. Issue is: >>> >> > >>> >> > If i create a column family altercations as: >>> >> > >>> >> > >>> >> > >>> **********************************************************************************************************8 >>> >> > CREATE TABLE altercations ( >>> >> > instigator text, >>> >> > started_at timestamp, >>> >> > ships_destroyed int, >>> >> > energy_used float, >>> >> > alliance_involvement boolean, >>> >> > PRIMARY KEY (instigator,started_at,ships_destroyed) >>> >> > ); >>> >> > / >>> >> > INSERT INTO altercations (instigator, started_at, >>> ships_destroyed, >>> >> > energy_used, alliance_involvement) >>> >> > VALUES ('Jayne Cobb', '2012-07-23', 2, 4.6, >>> >> > 'false'); >>> >> > >>> >> > >>> ********************************************************************************************************************* >>> >> > >>> >> > it works! >>> >> > >>> >> > But if i create a column family with compound primary key with 2 >>> >> > composite >>> >> > column as: >>> >> > >>> >> > CREATE TABLE altercations ( >>> >> > instigator text, >>> >> > started_at timestamp, >>> >> > ships_destroyed int, >>> >> > energy_used float, >>> >> > alliance_involvement boolean, >>> >> > PRIMARY KEY (instigator,started_at) >>> >> > ); >>> >> > >>> >> > >>> >> > >>> ********************************************************************************************************************* >>> >> > and Then drop this column family: >>> >> > >>> >> > drop columnfamily altercations; >>> >> > >>> >> > and then try to create same one with primary compound key with 3 >>> >> > composite >>> >> > column: >>> >> > >>> >> > CREATE TABLE altercations ( >>> >> > instigator text, >>> >> > started_at timestamp, >>> >> > ships_destroyed int, >>> >> > energy_used float, >>> >> > alliance_involvement boolean, >>> >> > PRIMARY KEY (instigator,started_at,ships_destroyed) >>> >> > ); >>> >> > >>> >> > it gives me error: "TSocket read 0 bytes" >>> >> > >>> >> > Rest, as no column family is created, so nothing onwards will work. >>> >> > >>> >> > Is this an issue? >>> >> >>> >> Sounds like it yes (I mean the theory is, you shouldn't ever get such >>> >> an error by creating and dropping tables. Even if you do something >>> >> wrong, you should get a meaningful error). >>> >> >>> >> Is there an exception in the log server side? (it's often the case >>> >> with a "TSocket read 0 bytes"). >>> >> >>> >> -- >>> >> Sylvain >>> > >>> > >>> >> >> > --047d7b10cc6b4a679d04cb9c7550 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 1 strange issue with 1.1.5 .


It works wit= h CQL3:

******************************************= ***************************************************************************= *****************************8
CREATE TABLE altercations (
=A0 =A0 =A0 =A0 =A0 =A0 ...= =A0 =A0 =A0 =A0instigator text,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 = =A0 =A0 =A0started_at timestamp,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 = =A0 =A0 =A0ships_destroyed int,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 = =A0 =A0 =A0energy_used float,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0alliance_involvement boolea= n,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0PRIMARY KEY (instig= ator,started_at)
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0);
= cqlsh:testcomp> drop columnfamily altercations;
cqlsh:testcomp> CREATE TABLE altercations (
=A0 =A0 =A0 = =A0 =A0 =A0 ... =A0 =A0 =A0 =A0instigator text,
=A0 =A0 =A0 =A0 = =A0 =A0 ... =A0 =A0 =A0 =A0started_at timestamp,
=A0 =A0 =A0 =A0 = =A0 =A0 ... =A0 =A0 =A0 =A0ships_destroyed int,
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0energy_used float,
=A0= =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0alliance_involvement boolean,
=
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0PRIMARY KEY (instigator,sta= rted_at,ships_destroyed)
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0);

cqlsh:testcomp> =A0 =A0INSERT INTO altercations (ins= tigator, started_at, ships_destroyed,
=A0 =A0 =A0 =A0 =A0 =A0 ...= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0energy_used, al= liance_involvement)
=A0 =A0 =A0 =A0 =A0 =A0 ... =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0VALUES ('Jayne Cobb', '2012-07-23= 9;, 2, 4.6, 'false');

cqlsh:testcomp> select * from altercations;
=A0instigator | started_at =A0 =A0 =A0 =A0 =A0 =A0 =A0 | ships_destroyed = | alliance_involvement | energy_used
------------+---------------= -----------+-----------------+----------------------+-------------
=A0Jayne Cobb | 2012-07-23 00:00:00+0000 | =A0 =A0 =A0 =A0 =A0 =A0 =A0= 2 | =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0False | =A0 =A0 =A0 =A0 4.6
<= br>
*************************************************************= ***************************************************************************= **********8

But after this when i try with cassandra-cli (to fetch = this record):

[default@testcomp] list alterca= tions;
Using default limit of 100
Using default column = limit of 100
-------------------
RowKey: Jayne Cobb
=3D> (co= lumn=3D2012-07-23 00:00:00+0530:2:alliance_involvement, value=3D, timestamp= =3D1349772570037000)
invalid UTF8 bytes 40933333
=

gives me =A0{invalid UTF8 bytes 40933333}=A0


Not sure, whether it will behave in same way= if i go with thrift java client? =A0Is this a problem CQL or thrift API?= =A0

-Vivek

On Tue,= Oct 9, 2012 at 2:14 PM, Vivek Mishra <mishra.vivs@gmail.com> wrote:
Works fine with 1.1.5

Tha= nks,
-Vivek


On Tue, Oct 9, 2012 at 1:59 PM, Vivek Mishra <mishra.vivs@gmail.com> wrote:
I am going to try it on 1.1.5

=
In case if you can point me to changes made in between since 1.1.2 to = 1.1.5 . It will be great.

-Vivek


On Tue, Oct 9, 2012 at 1:51 PM, Sylvain Lebresne <sylvain@data= stax.com> wrote:
On Tue, Oct 9, 2012 at 9:50 AM, Vivek M= ishra <mishra= .vivs@gmail.com> wrote:
> Unfortunately nothing in server logs leads me to any error.

Ok. Would you mind checking if you can reproduce against 1.1.5 if you=
haven't already. If it does, do you mind opening a JIRA ticket with
the steps to reproduce?

Thanks,
Sylvain

>
> -Vivek
>
>
> On Tue, Oct 9, 2012 at 1:16 PM, Sylvain Lebresne <sylvain@datastax.com>
> wrote:
>>
>> On Tue, Oct 9, 2012 at 8:57 AM, Vivek Mishra <mishra.vivs@gmail.com>
>> wrote:
>> > Ok. I am able to understand the problem now. Issue is:
>> >
>> > If i create a column family altercations as:
>> >
>> >
>> > *************************************************************= *********************************************8
>> > CREATE TABLE altercations (
>> > =A0 =A0 =A0 =A0instigator text,
>> > =A0 =A0 =A0 =A0started_at timestamp,
>> > =A0 =A0 =A0 =A0ships_destroyed int,
>> > =A0 =A0 =A0 =A0energy_used float,
>> > =A0 =A0 =A0 =A0alliance_involvement boolean,
>> > =A0 =A0 =A0 =A0PRIMARY KEY (instigator,started_at,ships_destr= oyed)
>> > =A0 =A0);
>> > /
>> > =A0 =A0INSERT INTO altercations (instigator, started_at, ship= s_destroyed,
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0en= ergy_used, alliance_involvement)
>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0VALUES ('Jayne= Cobb', '2012-07-23', 2, 4.6,
>> > 'false');
>> >
>> > *************************************************************= ********************************************************
>> >
>> > it works!
>> >
>> > But if i create a column family with compound primary key wit= h 2
>> > composite
>> > column as:
>> >
>> > CREATE TABLE altercations (
>> > =A0 =A0 =A0 =A0instigator text,
>> > =A0 =A0 =A0 =A0started_at timestamp,
>> > =A0 =A0 =A0 =A0ships_destroyed int,
>> > =A0 =A0 =A0 =A0energy_used float,
>> > =A0 =A0 =A0 =A0alliance_involvement boolean,
>> > =A0 =A0 =A0 =A0PRIMARY KEY (instigator,started_at)
>> > =A0 =A0);
>> >
>> >
>> > *************************************************************= ********************************************************
>> > and Then drop this column family:
>> >
>> > drop columnfamily altercations;
>> >
>> > and then try to create same one with primary compound key wit= h 3
>> > composite
>> > column:
>> >
>> > CREATE TABLE altercations (
>> > =A0 =A0 =A0 =A0instigator text,
>> > =A0 =A0 =A0 =A0started_at timestamp,
>> > =A0 =A0 =A0 =A0ships_destroyed int,
>> > =A0 =A0 =A0 =A0energy_used float,
>> > =A0 =A0 =A0 =A0alliance_involvement boolean,
>> > =A0 =A0 =A0 =A0PRIMARY KEY (instigator,started_at,ships_destr= oyed)
>> > =A0 =A0);
>> >
>> > it gives me error: "TSocket read 0 bytes"
>> >
>> > Rest, as no column family is created, so nothing onwards will= work.
>> >
>> > Is this an issue?
>>
>> Sounds like it yes (I mean the theory is, you shouldn't ever g= et such
>> an error by creating and dropping tables. Even if you do something=
>> wrong, you should get a meaningful error).
>>
>> Is there an exception in the log server side? (it's often the = case
>> with a "TSocket read 0 bytes").
>>
>> --
>> Sylvain
>
>



--047d7b10cc6b4a679d04cb9c7550--