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 20B3ECEAB for ; Tue, 10 Jul 2012 14:37:50 +0000 (UTC) Received: (qmail 30718 invoked by uid 500); 10 Jul 2012 14:37:47 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 30473 invoked by uid 500); 10 Jul 2012 14:37:47 -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 30456 invoked by uid 99); 10 Jul 2012 14:37:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 14:37:46 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sylvain@datastax.com designates 209.85.220.172 as permitted sender) Received: from [209.85.220.172] (HELO mail-vc0-f172.google.com) (209.85.220.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jul 2012 14:37:40 +0000 Received: by vcqp1 with SMTP id p1so32172vcq.31 for ; Tue, 10 Jul 2012 07:37:19 -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:content-transfer-encoding:x-gm-message-state; bh=r2ypZNfECxaTnbmIWSONWJjYK87A9YNGrrSY1z/3P24=; b=fe7HzXLWC1rx3SCvjP0sfwWrmmDgjv+rTJSKQ3aJSILLAVMGrn/61N6HkH1kvMY5iI Grp3n5TElXsUSZ9RxPJxw69rKB2Ptpb0KZLMd1ZJVNZ/B9ILHB1NxpHlSv3e+Bsq98Tj 77uD2MiRVBKVvycakcKaFckp6+wLBbuWh2smAkIoamsDioz8iT4+Bw4bequNZHfMS/MD Rk7vWBZ3DZ81VQK9d8KEGeMHfD/oor1LbMW80ltvEn+F7lzIs5gqH8w6TxCaU8WA0MEj O2zme/69jFkDor6+3wXRqFc01ARtiWMsYD9k/bP5HnJWOVb99QRiZDDhe9bZD63CJWzg V9Ng== MIME-Version: 1.0 Received: by 10.52.19.133 with SMTP id f5mr17773788vde.41.1341931039436; Tue, 10 Jul 2012 07:37:19 -0700 (PDT) Received: by 10.220.101.132 with HTTP; Tue, 10 Jul 2012 07:37:19 -0700 (PDT) In-Reply-To: References: <41A0E175-CC7F-49CE-8D1C-5B6624777D19@thelastpickle.com> <68406753-8A12-4F7F-875D-1CB767F1C8CA@thelastpickle.com> <08AB4D4C-0569-4B51-A319-377D2280825C@gmail.com> Date: Tue, 10 Jul 2012 16:37:19 +0200 Message-ID: Subject: Re: Dynamic CF From: Sylvain Lebresne To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlzzh7FBX9ECZuPnvGeQ0c9Prwx3LVFPCzvd2rAbMwNKMFzHaynuW4KoI5/Zp9uxoWKdpyv On Tue, Jul 10, 2012 at 4:17 PM, Leonid Ilyevsky wrote: > So I guess, in the batch_mutate call, in the map that I pass to it, only = the first element of the composite key should be used as a key (because it = is the real key), and the other parts of the key should be passed as regula= r columns? Is this correct? While I am waiting for your confirmation, I am = going to try it. I would really advise you to use the BATCH statement of CQL3 rather than the thrift batch_mutate call. If only because until https://issues.apache.org/jira/browse/CASSANDRA-4377 is resolved it won't work at all, but also because the whole point of CQL3 is to hide that kind of complexity. -- Sylvain > > -----Original Message----- > From: Sylvain Lebresne [mailto:sylvain@datastax.com] > Sent: Tuesday, July 10, 2012 8:24 AM > To: user@cassandra.apache.org > Subject: Re: Dynamic CF > > On Fri, Jul 6, 2012 at 10:49 PM, Leonid Ilyevsky > wrote: >> At this point I am really confused about what direction Cassandra is goi= ng. CQL 3 has the benefit of composite keys, but no dynamic columns. >> I thought, the whole point of Cassandra was to provide dynamic tables. > > CQL3 absolutely provide "dynamic tables"/wide rows, the syntax is just > different. The typical example for wide rows is a time serie, for > instance keeping all the events for a given event_kind in the same C* > row ordered by time. You declare that in CQL3 using: > CREATE TABLE events ( > event_kind text, > time timestamp, > event_name text, > event_details text, > PRIMARY KEY (event_kind, time) > ) > > The important part in such definition is that one CQL row (i.e a given > event_kind, time, event_name, even_details) does not map to an internal > Cassandra row. More precisely, all events sharing the same event_kind wil= l be > in the same internal row. This is a wide row/dynamic table in the sense o= f > thrift. > > >> I need to have a huge table to store market quotes, and be able to query= it by name and timestamp (t1 <=3D t <=3D t2), therefore I wanted the compo= site key. >> Loading data to such table using prepared statements (CQL 3-based) was v= ery slow, because it makes a server call for each row. > > You should use a BATCH statement which is the equivalent to batch_mutate. > > -- > Sylvain > > This email, along with any attachments, is confidential and may be legall= y privileged or otherwise protected from disclosure. Any unauthorized disse= mination, copying or use of the contents of this email is strictly prohibit= ed and may be in violation of law. If you are not the intended recipient, a= ny disclosure, copying, forwarding or distribution of this email is strictl= y prohibited and this email and any attachments should be deleted immediate= ly. This email and any attachments do not constitute an offer to sell or a= solicitation of an offer to purchase any interest in any investment vehicl= e sponsored by Moon Capital Management LP ("Moon Capital"). Moon Capital do= es not provide legal, accounting or tax advice. Any statement regarding leg= al, accounting or tax matters was not intended or written to be relied upon= by any person as advice. Moon Capital does not waive confidentiality or pr= ivilege as a result of this email.