Package org.apache.datasketches.hive.kll

## Class GetRankUDF

- java.lang.Object
- - org.apache.hadoop.hive.ql.exec.UDF
  - - org.apache.datasketches.hive.kll.GetRankUDF

    public class GetRankUDF
    extends org.apache.hadoop.hive.ql.exec.UDF

### Constructor Summary

Constructors
`GetRankUDF()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Double` `evaluate​(org.apache.hadoop.io.BytesWritable serializedSketch, float value)` Returns a normalized rank of a given value from a given sketch
`Double` `evaluate​(org.apache.hadoop.io.BytesWritable serializedSketch, Boolean inclusive, float value)` Returns a normalized rank of a given value from a given sketch

### Methods inherited from class org.apache.hadoop.hive.ql.exec.UDF

`getRequiredFiles, getRequiredJars, getResolver, setResolver`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GetRankUDF

    public GetRankUDF()

### Method Detail

#### evaluate

    public Double evaluate​(org.apache.hadoop.io.BytesWritable serializedSketch,
                           float value)

Returns a normalized rank of a given value from a given sketch

Parameters:
  `serializedSketch` - serialized sketch
  `value` - the given value
Returns:
  rank

#### evaluate

    public Double evaluate​(org.apache.hadoop.io.BytesWritable serializedSketch,
                           Boolean inclusive,
                           float value)

Returns a normalized rank of a given value from a given sketch

Parameters:
  `serializedSketch` - serialized sketch
  `inclusive` - if true the weight of the given item is included into the rank. Otherwise the rank equals the sum of the weights of all items that are less than the given item
  `value` - the given value
Returns:
  rank