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 23AC1104C0 for ; Wed, 12 Jun 2013 06:03:24 +0000 (UTC) Received: (qmail 75568 invoked by uid 500); 12 Jun 2013 06:03:21 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 75515 invoked by uid 500); 12 Jun 2013 06:03:20 -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 75507 invoked by uid 99); 12 Jun 2013 06:03:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 06:03:20 +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 mainalimanoj@gmail.com designates 209.85.217.175 as permitted sender) Received: from [209.85.217.175] (HELO mail-lb0-f175.google.com) (209.85.217.175) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Jun 2013 06:03:14 +0000 Received: by mail-lb0-f175.google.com with SMTP id r10so4062361lbi.20 for ; Tue, 11 Jun 2013 23:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=+i3ZS5dgBKQV9k9AuFtEvWeG4uI/lKJsdsFGpvQgY8Q=; b=j0BgbDzCtHvNG53JQgqRmd0riYQNAfmUk1ICTRzCy7FUO2b13CiSbsPJwBu9xOPLMF VCrK6kpyF9inf7NMX0Nks2i/MWof2LKQgwHaNfqmbbNWevMNDBRFKRHDimDQdF6OCxfM 67LhGHkJ7uBCqNISnEcFLlZoRi9D3Btd2365fMXaYl4Wp8CdoZaPMUQYW0odz19xYTv4 tdww+hk7X7NjVS+rhTpI6DI1nVN3SKE7nUm+cS8iaKFp0HhRO3R9iuXLQyVI5UUq4Lxd HVdZPaeYhCzpPF8mDj3cpCme+1hf9Nm0Yn7q4fUjn3nI2pnzkOOQnDgXTMr+2TeYHcmW vRMw== MIME-Version: 1.0 X-Received: by 10.112.63.2 with SMTP id c2mr10257114lbs.6.1371016973761; Tue, 11 Jun 2013 23:02:53 -0700 (PDT) Received: by 10.114.186.198 with HTTP; Tue, 11 Jun 2013 23:02:53 -0700 (PDT) Date: Wed, 12 Jun 2013 15:02:53 +0900 Message-ID: Subject: PerRowSecondaryIndex uses From: Manoj Mainali To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=001a11c3e880b3c0b904deeec390 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3e880b3c0b904deeec390 Content-Type: text/plain; charset=ISO-8859-1 I am looking into the C* secondary index feature so that I could query the rows based on the column value. In my use case, I wanted to create index of several columns or maybe all columns of a row. (A single row does not have many columns, maybe around 50 - 100 columns) and was looking into PerRowSecondaryIndex, but I could not find a way to create index using this. First, C* does not have a default implementation of it like KeysIndex for PerColumnSecondaryIndex, so I implemented my own. However, I could not find a way on how I could define it on the client side. The only way I was able to use it was to define the PerRowSecondaryIndex class when creating a column index as follows (assuming astyanax client) ColumnDefinition cd = cluster.makeColumnDefinition(); cd.setName("Index1"); cd.setIndex("INDEX_NAME", "CUSTOM"); cd.setValidationClass("AsciiType"); cd.setOption("class_name", "org.apache.cassandra.db.index.PerRowSecondaryIndexImpl"); cfDef.addColumnDefinition(cd); But, this approach would mean although I am creating a index for the whole row I am doing it through a index creation of a single column. Is there a better way of creating the row level index? Any examples on how to do that, if any? Best regards, Manoj --001a11c3e880b3c0b904deeec390 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I am looking into the C* secondary index feature so that I= could query the rows based on the column value. In my use case, I wanted t= o create index of =A0several columns or maybe all columns of a row. (A sing= le row does not have many columns, maybe around 50 - 100 columns) and was l= ooking into PerRowSecondaryIndex, but I could not find a way to create inde= x using this.

First, C* does not have a default implementation of it like = KeysIndex for PerColumnSecondaryIndex, so I implemented my own. However, I = could not find a way on how I could define it on the client side.

The only way I was able to use it was to define t= he PerRowSecondaryIndex class when creating a column index as follows (assu= ming astyanax client)

ColumnDefin= ition cd =3D cluster.makeColumnDefinition();
cd.setName("Index1");
cd.setIndex("INDEX_NAME= ", "CUSTOM");
cd.setValidationClass("AsciiTyp= e");
cd.setOption("class_name", "org.apache.c= assandra.db.index.PerRowSecondaryIndexImpl");
cfDef.addColumnDefinition(cd);

But, thi= s approach would mean although I am creating a index for the whole row I am= doing it through a index creation of a single column.

Is there a better way of creating the row level index?= Any examples on how to do that, if any?

Best regards,

Manoj




--001a11c3e880b3c0b904deeec390--