Enum RankType
- java.lang.Object
-
- java.lang.Enum<RankType>
-
- org.apache.flink.table.runtime.operators.rank.RankType
-
- All Implemented Interfaces:
Serializable
,Comparable<RankType>
public enum RankType extends Enum<RankType>
An enumeration of rank type, usable to show how exactly generate rank number.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DENSE_RANK
is similar to the RANK by generating a unique rank number for each distinct row within the partition based on the order, starting at 1 for the first row in each partition, ranking the rows with equal values with the same rank number, except that it does not skip any rank, leaving no gaps between the ranks.RANK
Returns a unique rank number for each distinct row within the partition based on the order, starting at 1 for the first row in each partition, with the same rank for duplicate values and leaving gaps between the ranks; this gap appears in the sequence after the duplicate values.ROW_NUMBER
Returns a unique sequential number for each row within the partition based on the order, starting at 1 for the first row in each partition and without repeating or skipping numbers in the ranking result of each partition.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RankType
valueOf(String name)
Returns the enum constant of this type with the specified name.static RankType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ROW_NUMBER
public static final RankType ROW_NUMBER
Returns a unique sequential number for each row within the partition based on the order, starting at 1 for the first row in each partition and without repeating or skipping numbers in the ranking result of each partition. If there are duplicate values within the row set, the ranking numbers will be assigned arbitrarily.
-
RANK
public static final RankType RANK
Returns a unique rank number for each distinct row within the partition based on the order, starting at 1 for the first row in each partition, with the same rank for duplicate values and leaving gaps between the ranks; this gap appears in the sequence after the duplicate values.
-
DENSE_RANK
public static final RankType DENSE_RANK
is similar to the RANK by generating a unique rank number for each distinct row within the partition based on the order, starting at 1 for the first row in each partition, ranking the rows with equal values with the same rank number, except that it does not skip any rank, leaving no gaps between the ranks.
-
-
Method Detail
-
values
public static RankType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RankType c : RankType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RankType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
-