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 3B2BC200BBD for ; Tue, 8 Nov 2016 21:18:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3A04B160AD0; Tue, 8 Nov 2016 20:18:00 +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 8AE01160B0C for ; Tue, 8 Nov 2016 21:17:59 +0100 (CET) Received: (qmail 58490 invoked by uid 500); 8 Nov 2016 20:17:58 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 58446 invoked by uid 99); 8 Nov 2016 20:17:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 20:17:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 821E62C2A66 for ; Tue, 8 Nov 2016 20:17:58 +0000 (UTC) Date: Tue, 8 Nov 2016 20:17:58 +0000 (UTC) From: "Jesus Camacho Rodriguez (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-15160) Can't order by an unselected column MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 08 Nov 2016 20:18:00 -0000 [ https://issues.apache.org/jira/browse/HIVE-15160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15648686#comment-15648686 ] Jesus Camacho Rodriguez commented on HIVE-15160: ------------------------------------------------ Thanks for double-checking [~pxiong], I may be wrong then. > Can't order by an unselected column > ----------------------------------- > > Key: HIVE-15160 > URL: https://issues.apache.org/jira/browse/HIVE-15160 > Project: Hive > Issue Type: Bug > Reporter: Pengcheng Xiong > Assignee: Pengcheng Xiong > > If a grouping key hasn't been selected, Hive complains. For comparison, Postgres does not. > Example. Notice i_item_id is not selected: > {code} > select i_item_desc > ,i_category > ,i_class > ,i_current_price > ,sum(cs_ext_sales_price) as itemrevenue > ,sum(cs_ext_sales_price)*100/sum(sum(cs_ext_sales_price)) over > (partition by i_class) as revenueratio > from catalog_sales > ,item > ,date_dim > where cs_item_sk = i_item_sk > and i_category in ('Jewelry', 'Sports', 'Books') > and cs_sold_date_sk = d_date_sk > and d_date between cast('2001-01-12' as date) > and (cast('2001-01-12' as date) + 30 days) > group by i_item_id > ,i_item_desc > ,i_category > ,i_class > ,i_current_price > order by i_category > ,i_class > ,i_item_id > ,i_item_desc > ,revenueratio > limit 100; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)