-Re: What is this windowing query supposed to do?
Harish Butani 2013-09-02, 00:36
In your 3rd query the OVER clause is being ignored because there is no associated Aggregation Function.
This has been fixed in HIVE-4214. The query fails with the following error:
'cannot recognize input near 'range' 'OVER' '(' in select expression'
The Windowing behavior in Hive is documented in HIVE-4197
On Sep 1, 2013, at 2:04 PM, Edward Capriolo <[EMAIL PROTECTED]> wrote:
> hive> select * from field_goal;
> tynes 44 miss
> tynes 40 miss
> tynes 33 make
> pete 20 make
> pete 21 make
> arnold 56 make
> arnold 22 make
> arnold 45 miss
> Time taken: 0.04 seconds, Fetched: 8 row(s)
> This makes sense:
> hive> select name,avg(range) OVER (PARTITION by name ORDER by range) FROM field_goal ;
> arnold 22.0
> arnold 33.5
> arnold 41.0
> pete 20.0
> pete 20.5
> tynes 33.0
> tynes 36.5
> tynes 39.0
> Time taken: 4.14 seconds, Fetched: 8 row(s)
> but what is this?
> hive> select name,range OVER (PARTITION by name ORDER by range) FROM field_goal ;
> tynes 44
> tynes 40
> tynes 33
> pete 20
> pete 21
> arnold 56
> arnold 22
> arnold 45
> Time taken: 3.709 seconds, Fetched: 8 row(s)
> It would be great if the https://cwiki.apache.org/Hive/languagemanual-windowingandanalytics.html#LanguageManualWindowingAndAnalytics-PARTITIONBYwithpartitioning%252CORDERBY%252Candwindowspecification
> Most of the links here:
> are broken...
> What gives?
> The language manual used to be fairly useful, now it is in major dis-array.
NOTICE: This message is intended for the use of the individual or entity to
which it is addressed and may contain information that is confidential,
privileged and exempt from disclosure under applicable law. If the reader
of this message is not the intended recipient, you are hereby notified that
any printing, copying, dissemination, distribution, disclosure or
forwarding of this communication is strictly prohibited. If you have
received this communication in error, please contact the sender immediately
and delete it from your system. Thank You.