Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> What is this windowing query supposed to do?


Copy link to this message
-
What is this windowing query supposed to do?
hive> select * from field_goal;
OK
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:
https://cwiki.apache.org/Hive/languagemanual.html

are broken...
What gives?
The language manual used to be fairly useful, now it is in major dis-array.