Package org.apache.calcite.sql.validate
Enum SqlMonotonicity
- All Implemented Interfaces:
Serializable
,Comparable<SqlMonotonicity>
,Constable
Enumeration of types of monotonicity.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionCatch-all value for expressions that have some monotonic properties. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether values of this monotonicity are decreasing.boolean
Returns whether values of this monotonicity may ever repeat after moving to another value: true forNOT_MONOTONIC
andCONSTANT
, false otherwise.reverse()
Returns the reverse monotonicity.unstrict()
If this is a strict monotonicity (StrictlyIncreasing, StrictlyDecreasing) returns the non-strict equivalent (Increasing, Decreasing).static SqlMonotonicity
Returns the enum constant of this type with the specified name.static SqlMonotonicity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
STRICTLY_INCREASING
-
INCREASING
-
STRICTLY_DECREASING
-
DECREASING
-
CONSTANT
-
MONOTONIC
Catch-all value for expressions that have some monotonic properties. Maybe it isn't known whether the expression is increasing or decreasing; or maybe the value is neither increasing nor decreasing but the value never repeats. -
NOT_MONOTONIC
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
unstrict
If this is a strict monotonicity (StrictlyIncreasing, StrictlyDecreasing) returns the non-strict equivalent (Increasing, Decreasing).- Returns:
- non-strict equivalent monotonicity
-
reverse
Returns the reverse monotonicity.- Returns:
- reverse monotonicity
-
isDecreasing
public boolean isDecreasing()Whether values of this monotonicity are decreasing. That is, if a value at a given point in a sequence is X, no point later in the sequence will have a value greater than X.- Returns:
- whether values are decreasing
-
mayRepeat
public boolean mayRepeat()Returns whether values of this monotonicity may ever repeat after moving to another value: true forNOT_MONOTONIC
andCONSTANT
, false otherwise.If a column is known not to repeat, a sort on that column can make progress before all of the input has been seen.
- Returns:
- whether values repeat
-