Package com.redis.vl.query
Enum Class ReducerFunction
- All Implemented Interfaces:
Serializable
,Comparable<ReducerFunction>
,Constable
Enumeration of available reducer functions for Redis aggregation operations.
Ported from Redis OM Spring ReducerFunction.java
These functions correspond to the reducer functions available in RediSearch aggregation queries. Each function performs a specific type of calculation or transformation on grouped data during aggregation operations.
Reducer functions are categorized into:
- Counting functions: COUNT, COUNT_DISTINCT, COUNT_DISTINCTISH
- Mathematical functions: SUM, MIN, MAX, AVG, STDDEV
- Statistical functions: QUANTILE, RANDOM_SAMPLE
- Collection functions: TOLIST, FIRST_VALUE
- Since:
- 0.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionREDUCE AVG 1 {property} - Return the average value of a numeric property.REDUCE COUNT 0 - Count the number of records in each groupREDUCE COUNT_DISTINCT 1 {property} - Count the number of distinct values for property.REDUCE COUNT_DISTINCTISH 1 {property} - Same as COUNT_DISTINCT but provides an approximation instead of an exact countREDUCE FIRST_VALUE {nargs} {property} [BY {property} [ASC|DESC]] - Return the first or top value of a given property in the group, optionally by comparing that or another propertyREDUCE MAX 1 {property} - Return the maximal value of a property, whether it is a string, number or NULL.REDUCE MIN 1 {property} - Return the minimal value of a property, whether it is a string, number or NULL.REDUCE QUANTILE 2 {property} {quantile} - Return the value of a numeric property at a given quantile of the results.REDUCE RANDOM_SAMPLE {nargs} {property} {sample_size} - Perform a reservoir sampling of the group elements with a given size, and return an array of the sampled items with an even distribution.REDUCE STDDEV 1 {property} - Return the standard deviation of a numeric property in the group.REDUCE SUM 1 {property} - Return the sum of all numeric values of a given property in a group.REDUCE TOLIST 1 {property} - Merge all distinct values of a given property into a single array. -
Method Summary
Modifier and TypeMethodDescriptionstatic ReducerFunction
Returns the enum constant of this class with the specified name.static ReducerFunction[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COUNT
REDUCE COUNT 0 - Count the number of records in each group -
COUNT_DISTINCT
REDUCE COUNT_DISTINCT 1 {property} - Count the number of distinct values for property. -
COUNT_DISTINCTISH
REDUCE COUNT_DISTINCTISH 1 {property} - Same as COUNT_DISTINCT but provides an approximation instead of an exact count -
SUM
REDUCE SUM 1 {property} - Return the sum of all numeric values of a given property in a group. Non-numeric values if the group are counted as 0. -
MIN
REDUCE MIN 1 {property} - Return the minimal value of a property, whether it is a string, number or NULL. -
MAX
REDUCE MAX 1 {property} - Return the maximal value of a property, whether it is a string, number or NULL. -
AVG
REDUCE AVG 1 {property} - Return the average value of a numeric property. -
STDDEV
REDUCE STDDEV 1 {property} - Return the standard deviation of a numeric property in the group. -
QUANTILE
REDUCE QUANTILE 2 {property} {quantile} - Return the value of a numeric property at a given quantile of the results. Quantile is expressed as a number between 0 and 1. -
TOLIST
REDUCE TOLIST 1 {property} - Merge all distinct values of a given property into a single array. -
FIRST_VALUE
REDUCE FIRST_VALUE {nargs} {property} [BY {property} [ASC|DESC]] - Return the first or top value of a given property in the group, optionally by comparing that or another property -
RANDOM_SAMPLE
REDUCE RANDOM_SAMPLE {nargs} {property} {sample_size} - Perform a reservoir sampling of the group elements with a given size, and return an array of the sampled items with an even distribution.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-