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 28565111B2 for ; Wed, 30 Jul 2014 08:44:40 +0000 (UTC) Received: (qmail 71781 invoked by uid 500); 30 Jul 2014 08:44:39 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 71674 invoked by uid 500); 30 Jul 2014 08:44:38 -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 71487 invoked by uid 500); 30 Jul 2014 08:44:38 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 71459 invoked by uid 99); 30 Jul 2014 08:44:38 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 08:44:38 +0000 Date: Wed, 30 Jul 2014 08:44:38 +0000 (UTC) From: "Lars Francke (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-4933) Document how aliases work with the OVER clause MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-4933?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14079077#comment-14079077 ] Lars Francke commented on HIVE-4933: ------------------------------------ The proper usage turns out to be {code:sql} SELECT SUM(foo) OVER (PARTITION BY foo) AS bar FROM test; {code} I have added documentation to the Wiki for this. > Document how aliases work with the OVER clause > ---------------------------------------------- > > Key: HIVE-4933 > URL: https://issues.apache.org/jira/browse/HIVE-4933 > Project: Hive > Issue Type: Bug > Affects Versions: 0.11.0 > Reporter: Lars Francke > Assignee: Lars Francke > Priority: Minor > > {code} > CREATE TABLE test (foo INT); > hive> SELECT SUM(foo) AS bar OVER (PARTITION BY foo) FROM test; > MismatchedTokenException(175!=110) > at org.antlr.runtime.BaseRecognizer.recoverFromMismatchedToken(BaseRecognizer.java:617) > at org.antlr.runtime.BaseRecognizer.match(BaseRecognizer.java:115) > at org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.fromClause(HiveParser_FromClauseParser.java:1424) > at org.apache.hadoop.hive.ql.parse.HiveParser.fromClause(HiveParser.java:35998) > at org.apache.hadoop.hive.ql.parse.HiveParser.selectStatement(HiveParser.java:33974) > at org.apache.hadoop.hive.ql.parse.HiveParser.regular_body(HiveParser.java:33882) > at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatement(HiveParser.java:33389) > at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:33169) > at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1284) > at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:983) > at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:190) > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:434) > at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:352) > at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:995) > at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1038) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:931) > at org.apache.hadoop.hive.ql.Driver.run(Driver.java:921) > at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:268) > at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:220) > at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:422) > at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:790) > at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:684) > at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:623) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.apache.hadoop.util.RunJar.main(RunJar.java:212) > FAILED: ParseException line 1:20 mismatched input 'OVER' expecting FROM near 'bar' in from clause{code} > The same happens without the {{AS}} but it works when leaving out the alias entirely. -- This message was sent by Atlassian JIRA (v6.2#6252)