Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3749D11297 for ; Wed, 20 Aug 2014 12:41:27 +0000 (UTC) Received: (qmail 7494 invoked by uid 500); 20 Aug 2014 12:41:27 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 7468 invoked by uid 500); 20 Aug 2014 12:41:27 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 7451 invoked by uid 99); 20 Aug 2014 12:41:27 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 12:41:26 +0000 Date: Wed, 20 Aug 2014 12:41:26 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-7016) can't map/reduce over subset of rows with cql MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-7016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-7016: -------------------------------------- Attachment: CASSANDRA-7016-V2.txt I forgot to modify the SelectStatement execute method in the previous patch. > can't map/reduce over subset of rows with cql > --------------------------------------------- > > Key: CASSANDRA-7016 > URL: https://issues.apache.org/jira/browse/CASSANDRA-7016 > Project: Cassandra > Issue Type: Bug > Components: Core, Hadoop > Reporter: Jonathan Halliday > Assignee: Benjamin Lerer > Priority: Minor > Labels: cql > Fix For: 2.1.1 > > Attachments: CASSANDRA-7016-V2.txt, CASSANDRA-7016.txt > > > select ... where token(k) < x and token(k) >= y and k in (a,b) allow filtering; > This fails on 2.0.6: can't restrict k by more than one relation. > In the context of map/reduce (hence the token range) I want to map over only a subset of the keys (hence the 'in'). Pushing the 'in' filter down to cql is substantially cheaper than pulling all rows to the client and then discarding most of them. > Currently this is possible only if the hadoop integration code is altered to apply the AND on the client side and use cql that contains only the resulting filtered 'in' set. The problem is not hadoop specific though, so IMO it should really be solved in cql not the hadoop integration code. > Most restrictions on cql syntax seem to exist to prevent unduly expensive queries. This one seems to be doing the opposite. > Edit: on further thought and with reference to the code in SelectStatement$RawStatement, it seems to me that token(k) and k should be considered distinct entities for the purposes of processing restrictions. That is, no restriction on the token should conflict with a restriction on the raw key. That way any monolithic query in terms of k and be decomposed into parallel chunks over the token range for the purposes of map/reduce processing simply by appending a 'and where token(k)...' clause to the exiting 'where k ...'. -- This message was sent by Atlassian JIRA (v6.2#6252)