Return-Path: X-Original-To: apmail-phoenix-dev-archive@minotaur.apache.org Delivered-To: apmail-phoenix-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CEC8D11A61 for ; Fri, 2 May 2014 03:55:40 +0000 (UTC) Received: (qmail 83057 invoked by uid 500); 2 May 2014 03:55:40 -0000 Delivered-To: apmail-phoenix-dev-archive@phoenix.apache.org Received: (qmail 83013 invoked by uid 500); 2 May 2014 03:55:39 -0000 Mailing-List: contact dev-help@phoenix.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.incubator.apache.org Delivered-To: mailing list dev@phoenix.incubator.apache.org Received: (qmail 82997 invoked by uid 99); 2 May 2014 03:55:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 03:55:38 +0000 X-ASF-Spam-Status: No, hits=-2000.7 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 May 2014 03:55:37 +0000 Received: (qmail 82792 invoked by uid 99); 2 May 2014 03:55:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 May 2014 03:55:17 +0000 Date: Fri, 2 May 2014 03:55:16 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (PHOENIX-136) Support derived tables MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/PHOENIX-136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor resolved PHOENIX-136. ---------------------------------- Resolution: Fixed Fix Version/s: 4.1 3.1 5.0.0 Excellent work, [~maryannxue]. I think we have JIRAs opened already for any corner cases not yet supported, but if not, please open any missing ones. > Support derived tables > ---------------------- > > Key: PHOENIX-136 > URL: https://issues.apache.org/jira/browse/PHOENIX-136 > Project: Phoenix > Issue Type: Task > Reporter: James Taylor > Assignee: Maryann Xue > Labels: enhancement > Fix For: 5.0.0, 3.1, 4.1 > > > Add support for derived queries of the form: > SELECT * FROM ( SELECT company, revenue FROM Company ORDER BY revenue) LIMIT 10 > Adding support for this requires a compile time change as well as a runtime execution change. The first version of the compile-time change could limit aggregation to only be allowed in the inner or the outer query, but not both. In this case, the inner and outer queries can be combined into a single query with the outer select becoming just a remapping of a subset of the projection from the inner select. The second version of the compile-time change could handle aggregation in the inner and outer select by performing client side (this is likely a less common scenario). > For the runtime execution, change the UngroupedAggregateRegionObserver would be modified to look for a new "TopNLimit" attribute with an int value in the Scan. This would control the maximum number of values for the coprocessor to hold on to as the scan is performed. Then the GroupedAggregatingResultIterator would be modified to handle keeping the topN values received back from all the child iterators. -- This message was sent by Atlassian JIRA (v6.2#6252)