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 A351DDF93 for ; Tue, 9 Oct 2012 07:47:28 +0000 (UTC) Received: (qmail 54692 invoked by uid 500); 9 Oct 2012 07:47:26 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 54664 invoked by uid 500); 9 Oct 2012 07:47:26 -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 54650 invoked by uid 99); 9 Oct 2012 07:47:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Oct 2012 07:47:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sylvain@datastax.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 07:47:19 +0000 Received: by mail-pb0-f44.google.com with SMTP id ro8so4933713pbb.31 for ; Tue, 09 Oct 2012 00:46:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=5ejkHkj+zeZ8dmY0PymFwriLmCF1vZJhsXjRO/UKMG4=; b=jZgJL4AP/uVNZy6VaKsbXfmrOOmh3+I9RxkiIEfWStGSJkQK24dP4m+z6zNHgviDh9 wbHbA1c6WEgfauV7LER4nqdGCOx56R1FiMCW5y+MsMkkmOUMM5T9ELF6g8eP0lj6j5+l uyGIoJf35f4mUV20YoFYhQN7GcSENbxA0FuWrCKUXqsaT0lLIfp+Gm3P8SbIcpIoe0wT fvt6HIirZS0xx4c6lMDp/Hup9QZNleXzCOSbov0RYu51mYp36/S8PA6U4TPuiuANT3WP FWQAGVTdA5eGUSdVZf0RtiwMkYSn1k4/3Y7J5/BswW/CEGOb2+Dnqm8/czxQxYyla3Wj uUBQ== MIME-Version: 1.0 Received: by 10.68.197.197 with SMTP id iw5mr40024642pbc.22.1349768819251; Tue, 09 Oct 2012 00:46:59 -0700 (PDT) Received: by 10.68.64.70 with HTTP; Tue, 9 Oct 2012 00:46:59 -0700 (PDT) In-Reply-To: References: <17C39FE466076C46B6E83F129C7B19CE16B8B5B5@HKXPRD0310MB352.apcprd03.prod.outlook.com> Date: Tue, 9 Oct 2012 09:46:59 +0200 Message-ID: Subject: Re: Using compound primary key From: Sylvain Lebresne To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnhKN62zhwE8M99hNtB27n4vSw/bhy3PBbtn+t+tTzmCOpDTLRfsvVn+S+SWYdXUZMgaI3U X-Virus-Checked: Checked by ClamAV on apache.org 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