Generate Rank (In Database) (In-Database Processing)


This operator can generate the (dense) rank of each row within the given partition into a new column.


The rank of a row is one plus the count of ranks before the given row. The dense rank of a row is one plus the count of distinct ranks before the given row. Note that if no partitioning is defined, the entire data set is sorted, a potentially slow operation for a large data set. For adding a unique ID variable to the data set, you may want to use your database-specific function instead, e.g. ROWNUM for Oracle.


  • example set input


  • example set output


  • attribute_name Name of the attribute. Range: string
  • partition_by Ordered list of the partitioning attributes. Range: string
  • order_by The attributes and sorting directions which should be used to determine the order of the data before the ranking is applied. Range: list
  • dense_rank Dense Rank returns the rank of rows, within the partition of a result set, without any gaps in the ranking. Range: boolean