hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shahar Glixman <>
Subject Re: Semantics of Rank.
Date Wed, 24 Jul 2013 19:17:58 GMT
the argument to rank is simply some value, whereas the rank function
compare this value
 to the previous value received, if value is same, rank returns ++index,
otherwise, rank return 1.
pseudo code:

class Rank {
int index;
Object previousValue = null;
int evaluate(Object value) {
  if (value == previousValue) {
    return ++index;
  previousValue = value;
  index = 1;
  return 1;

On Wed, Jul 24, 2013 at 9:59 PM, j.barrett Strausser <> wrote:

> It seems as though I am required to pass in an argument to RANK().
> What is the effect of passing this argument in ?
> In a RANK function the output for RANK should be the number of rows
> preceding
> a row in a given window. As  windows are specified by the partition and
> order by fields I don't understand the effect of passing in an arg to RANK
> Are the other non-aggregate function similar? Meaning : Cume_dist, Ntile
> --
> @deepbearrito

The above terms reflect a potential business arrangement, are provided solely 
as a basis for further discussion, and are not intended to be and do not 
constitute a legally binding obligation. No legally binding obligations will 
be created, implied, or inferred until an agreement in final form is executed 
in writing by all parties involved.

This email and any attachments hereto may be confidential or privileged. 
 If you received this communication by mistake, please don't forward it to 
anyone else, please erase all copies and attachments, and please let me 
know that it has gone to the wrong person. Thanks.

View raw message