Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E70161177C for ; Thu, 5 Jun 2014 06:19:02 +0000 (UTC) Received: (qmail 86200 invoked by uid 500); 5 Jun 2014 06:19:02 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 86132 invoked by uid 500); 5 Jun 2014 06:19:02 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 86122 invoked by uid 500); 5 Jun 2014 06:19:02 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 86119 invoked by uid 99); 5 Jun 2014 06:19:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2014 06:19:02 +0000 Date: Thu, 5 Jun 2014 06:19:02 +0000 (UTC) From: "Yibing Shi (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HIVE-7178) Table alias cannot be used in GROUPING SETS clause if there are more than one column in it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Yibing Shi created HIVE-7178: -------------------------------- Summary: Table alias cannot be used in GROUPING SETS clause if there are more than one column in it Key: HIVE-7178 URL: https://issues.apache.org/jira/browse/HIVE-7178 Project: Hive Issue Type: Bug Components: SQL Affects Versions: 0.13.0 Reporter: Yibing Shi The following SQL doesn't work: EXPLAIN SELECT alias.a, alias.b, alias.c, COUNT(DISTINCT d) FROM table_name alias GROUP BY alias.a, alias.b, alias.c GROUPING SETS( (alias.a), (alias.b, alias.a) ); FAILED: ParseException line 15:34 missing ) at ',' near '' line 16:0 extraneous input ')' expecting EOF near '' The following SQL works (without alias in grouping set): EXPLAIN SELECT a, b, c, COUNT(DISTINCT d) FROM table_name GROUP BY a, b, c GROUPING SETS( (a), (b, a) ); Alias works for just one column: EXPLAIN SELECT alias.a, alias.b, alias.c, COUNT(DISTINCT d) FROM table_name alias GROUP BY alias.a, alias.b, alias.c GROUPING SETS( (alias.a) ); Using alias in GROUPING SETS could be very useful if multiple tables are involved in the SELECT (via JOIN) -- This message was sent by Atlassian JIRA (v6.2#6252)