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 BBE2C200CA4 for ; Wed, 24 May 2017 01:57:08 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BAE36160BD6; Tue, 23 May 2017 23:57:08 +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 0D580160BD3 for ; Wed, 24 May 2017 01:57:07 +0200 (CEST) Received: (qmail 80972 invoked by uid 500); 23 May 2017 23:57:07 -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 80963 invoked by uid 99); 23 May 2017 23:57:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2017 23:57:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E20D11A7A64 for ; Tue, 23 May 2017 23:57:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ziCGcPE3x9Rg for ; Tue, 23 May 2017 23:57:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id AE7295FD38 for ; Tue, 23 May 2017 23:57:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 20DE6E0DB7 for ; Tue, 23 May 2017 23:57:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 445E621B5E for ; Tue, 23 May 2017 23:57:04 +0000 (UTC) Date: Tue, 23 May 2017 23:57:04 +0000 (UTC) From: "Ashutosh Chauhan (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, 23 May 2017 23:57:08 -0000 [ https://issues.apache.org/jira/browse/HIVE-15160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022116#comment-16022116 ] Ashutosh Chauhan commented on HIVE-15160: ----------------------------------------- +1 > 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 > Attachments: HIVE-15160.01.patch, HIVE-15160.02.patch, HIVE-15160.04.patch, HIVE-15160.05.patch, HIVE-15160.06.patch, HIVE-15160.07.patch, HIVE-15160.08.patch, HIVE-15160.09.patch, HIVE-15160.09.patch, HIVE-15160.10.patch, HIVE-15160.11.patch, HIVE-15160.12.patch, HIVE-15160.13.patch, HIVE-15160.14.patch, HIVE-15160.15.patch, HIVE-15160.16.patch, HIVE-15160.17.patch > > > 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.15#6346)