Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 35FC0200BC3 for ; Fri, 18 Nov 2016 22:38:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 34BA2160B04; Fri, 18 Nov 2016 21:38:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 80B5F160B03 for ; Fri, 18 Nov 2016 22:38:00 +0100 (CET) Received: (qmail 61050 invoked by uid 500); 18 Nov 2016 21:37:59 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 61037 invoked by uid 99); 18 Nov 2016 21:37:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Nov 2016 21:37:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8B3002C0088 for ; Fri, 18 Nov 2016 21:37:59 +0000 (UTC) Date: Fri, 18 Nov 2016 21:37:58 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-3491) OrderBy can not be compiled out if GroupBy is not orderPreserving and OrderBy is reverse MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 18 Nov 2016 21:38:01 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor updated PHOENIX-3491: ---------------------------------- Attachment: PHOENIX-3491_v2.patch > OrderBy can not be compiled out if GroupBy is not orderPreserving and OrderBy is reverse > ---------------------------------------------------------------------------------------- > > Key: PHOENIX-3491 > URL: https://issues.apache.org/jira/browse/PHOENIX-3491 > Project: Phoenix > Issue Type: Improvement > Affects Versions: 4.8.0 > Reporter: chenglei > Assignee: chenglei > Attachments: PHOENIX-3491_v1.patch, PHOENIX-3491_v2.patch > > > for the following table: > {code:borderStyle=solid} > CREATE TABLE ORDERBY_TEST ( > ORGANIZATION_ID INTEGER NOT NULL, > CONTAINER_ID INTEGER NOT NULL, > SCORE INTEGER NOT NULL, > ENTITY_ID INTEGER NOT NULL, > CONSTRAINT TEST_PK PRIMARY KEY ( > ORGANIZATION_ID, > CONTAINER_ID, > SCORE, > ENTITY_ID > )); > {code} > > If we execute explain on the following sql: > {code:borderStyle=solid} > SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST GROUP BY ORGANIZATION_ID, SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC > {code} > the result is : > {code:borderStyle=solid} > ----------------------------------------------------------------------+ > | PLAN | > +----------------------------------------------------------------------+ > | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER ORDERBY_TEST | > | SERVER FILTER BY FIRST KEY ONLY | > | SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE] | > | CLIENT MERGE SORT | > | CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC] | > +----------------------------------------------------------------------+ > {code} > from the above explain result, we can see that the ORDER BY ORGANIZATION_ID DESC, SCORE DESC is not compiled out,but obviously it should be compiled out as OrderBy.REV_ROW_KEY_ORDER_BY. -- This message was sent by Atlassian JIRA (v6.3.4#6332)