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 29ADD19123 for ; Thu, 14 Apr 2016 10:41:26 +0000 (UTC) Received: (qmail 82071 invoked by uid 500); 14 Apr 2016 10:41:26 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 82039 invoked by uid 500); 14 Apr 2016 10:41:26 -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 81870 invoked by uid 99); 14 Apr 2016 10:41:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Apr 2016 10:41:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A6F9F2C1F60 for ; Thu, 14 Apr 2016 10:41:25 +0000 (UTC) Date: Thu, 14 Apr 2016 10:41:25 +0000 (UTC) From: "Benjamin Lerer (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-11339) WHERE clause in SELECT DISTINCT can be ignored 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-11339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benjamin Lerer updated CASSANDRA-11339: --------------------------------------- Resolution: Fixed Status: Resolved (was: Patch Available) Committed in 2.2 at 69edeaa46b78bb168f7e9d0b1c991c07b90f41ca. Committed in 3.0 at 6ad874509d6c7edd53bb3a4b897477d6a2753c19 and merged into trunk. > WHERE clause in SELECT DISTINCT can be ignored > ---------------------------------------------- > > Key: CASSANDRA-11339 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11339 > Project: Cassandra > Issue Type: Bug > Components: CQL > Reporter: Philip Thompson > Assignee: Alex Petrov > Fix For: 2.2.x, 3.x > > Attachments: 0001-Add-validation-for-distinct-queries-disallowing-quer.patch > > > I've tested this out on 2.1-head. I'm not sure if it's the same behavior on newer versions. > For a given table t, with {{PRIMARY KEY (id, v)}} the following two queries return the same result: > {{SELECT DISTINCT id FROM t WHERE v > X ALLOW FILTERING}} > {{SELECT DISTINCT id FROM t}} > The WHERE clause in the former is silently ignored, and all id are returned, regardless of the value of v in any row. > It seems like this has been a known issue for a while: > http://stackoverflow.com/questions/26548788/select-distinct-cql-ignores-where-clause > However, if we don't support filtering on anything but the partition key, we should reject the query, rather than silently dropping the where clause -- This message was sent by Atlassian JIRA (v6.3.4#6332)