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 5933618731 for ; Tue, 3 Nov 2015 19:57:33 +0000 (UTC) Received: (qmail 24996 invoked by uid 500); 3 Nov 2015 19:57:28 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 24860 invoked by uid 500); 3 Nov 2015 19:57:28 -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 24836 invoked by uid 99); 3 Nov 2015 19:57:28 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Nov 2015 19:57:28 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id E05DD2C1F5F for ; Tue, 3 Nov 2015 19:57:27 +0000 (UTC) Date: Tue, 3 Nov 2015 19:57:27 +0000 (UTC) From: "Tyler Hobbs (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10271) ORDER BY should allow skipping equality-restricted clustering columns 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-10271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14987990#comment-14987990 ] Tyler Hobbs commented on CASSANDRA-10271: ----------------------------------------- +1, it would be good to allow that as well. However, if that turns out to be more difficult to generalize for some reason, I would be okay with deferring that to another ticket. > ORDER BY should allow skipping equality-restricted clustering columns > --------------------------------------------------------------------- > > Key: CASSANDRA-10271 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10271 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Reporter: Tyler Hobbs > Assignee: Brett Snyder > Priority: Minor > Fix For: 3.x, 2.2.x > > Attachments: cassandra-2.2-10271.txt > > > Given a table like the following: > {noformat} > CREATE TABLE foo (a int, b int, c int, d int, PRIMARY KEY (a, b, c)); > {noformat} > We should support a query like this: > {noformat} > SELECT * FROM foo WHERE a = 0 AND b = 0 ORDER BY c ASC; > {noformat} > Currently, this results in the following error: > {noformat} > [Invalid query] message="Order by currently only support the ordering of columns following their declared order in the PRIMARY KEY" > {noformat} > However, since {{b}} is restricted by an equality restriction, we shouldn't require it to be present in the {{ORDER BY}} clause. > As a workaround, you can use this query instead: > {noformat} > SELECT * FROM foo WHERE a = 0 AND b = 0 ORDER BY b ASC, c ASC; > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)