Package tilda.enums
Enum AggregateType
- java.lang.Object
-
- java.lang.Enum<AggregateType>
-
- tilda.enums.AggregateType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AggregateType>
public enum AggregateType extends java.lang.Enum<AggregateType>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AggregateType.OrderableType
static class
AggregateType.ParameterSetting
static class
AggregateType.TargetColumnType
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.regex.Pattern
_AGG_REGEX
Pattern for an aggregate with params, e.g., "abced(param1, ...)".protected static java.lang.String[][]
_ALIASES
protected boolean
_composable
static java.lang.Integer
_DEFAULT_STRING_AGG_SIZE
For STRING aggregates, we can't reuse the size of the source column, so we set a default here of 10B which hopefully is enough 10MB = 10*1024*1024protected AggregateType.OrderableType
_orderable
protected AggregateType.ParameterSetting
_paramSetting
protected AggregateType.TargetColumnType
_targetColumn
protected boolean
_windowOnly
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areParametersAllowed()
AggregateType
getComposedAggregate()
AggregateType.OrderableType
getOrderable()
AggregateType.ParameterSetting
getParameterSetting()
ColumnType
getType(java.lang.String fullColumnName, ColumnType T, boolean needsTZ)
boolean
isCompatible(java.lang.String fullColumnName, ColumnType type, boolean needsTZ)
java.lang.String
isCompatible(ViewColumn VC)
boolean
isComposable()
boolean
isList()
AggregateType.TargetColumnType
isTargetColumnRequired()
boolean
isWindowOnly()
boolean
isZonedDateTimeCompatible()
Tests whether an aggregate is friendly with DateTime columns.static AggregateType
parse(java.lang.String str)
static java.lang.String
parseAttributes(java.lang.String aggregateStr)
Parses an attribute part of an aggregate, for example STRING(',').static AggregateType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AggregateType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SUM
public static final AggregateType SUM
-
AVG
public static final AggregateType AVG
-
MIN
public static final AggregateType MIN
-
MAX
public static final AggregateType MAX
-
FIRST
public static final AggregateType FIRST
-
LAST
public static final AggregateType LAST
-
DEV
public static final AggregateType DEV
-
VAR
public static final AggregateType VAR
-
COUNT
public static final AggregateType COUNT
-
ARRAY
public static final AggregateType ARRAY
-
STRING
public static final AggregateType STRING
-
ARRAYCAT
public static final AggregateType ARRAYCAT
-
ROW_NUMBER
public static final AggregateType ROW_NUMBER
-
RANK
public static final AggregateType RANK
-
PERCENT_RANK
public static final AggregateType PERCENT_RANK
-
LEAD
public static final AggregateType LEAD
-
LAG
public static final AggregateType LAG
-
NTH_VALUE
public static final AggregateType NTH_VALUE
-
-
Field Detail
-
_DEFAULT_STRING_AGG_SIZE
public static final java.lang.Integer _DEFAULT_STRING_AGG_SIZE
For STRING aggregates, we can't reuse the size of the source column, so we set a default here of 10B which hopefully is enough 10MB = 10*1024*1024
-
_windowOnly
protected final boolean _windowOnly
-
_composable
protected final boolean _composable
-
_orderable
protected final AggregateType.OrderableType _orderable
-
_targetColumn
protected final AggregateType.TargetColumnType _targetColumn
-
_paramSetting
protected final AggregateType.ParameterSetting _paramSetting
-
_ALIASES
protected static java.lang.String[][] _ALIASES
-
_AGG_REGEX
protected static final java.util.regex.Pattern _AGG_REGEX
Pattern for an aggregate with params, e.g., "abced(param1, ...)".
-
-
Method Detail
-
values
public static AggregateType[] 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 (AggregateType c : AggregateType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AggregateType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
isWindowOnly
public boolean isWindowOnly()
-
isComposable
public boolean isComposable()
-
getOrderable
public AggregateType.OrderableType getOrderable()
-
getParameterSetting
public AggregateType.ParameterSetting getParameterSetting()
-
isTargetColumnRequired
public AggregateType.TargetColumnType isTargetColumnRequired()
-
parse
public static AggregateType parse(java.lang.String str)
-
parseAttributes
public static java.lang.String parseAttributes(java.lang.String aggregateStr)
Parses an attribute part of an aggregate, for example STRING(','). Minimum syntax check is performed, i.e., checks that there is an open and close parenthesis at the beginning and end, and that what's inside is a standard list of comma-separated parameters- Parameters:
aggregateStr
-- Returns:
- null if an error occurred, otherwise, the emoty string if no attributes were found,
-
getType
public ColumnType getType(java.lang.String fullColumnName, ColumnType T, boolean needsTZ)
-
isCompatible
public java.lang.String isCompatible(ViewColumn VC)
-
isCompatible
public boolean isCompatible(java.lang.String fullColumnName, ColumnType type, boolean needsTZ)
-
getComposedAggregate
public AggregateType getComposedAggregate()
-
isZonedDateTimeCompatible
public boolean isZonedDateTimeCompatible()
Tests whether an aggregate is friendly with DateTime columns. Because DateTime columns have a companion TZ column to maintain the timezone information, aggregates that cannot be ordered essentially are not usable. This method simply wraps isOrderable() in case we later need to make some modifications, i.e., the isTimeZoneCompatible is semantically different enough from isOrderable that we didn't want to alias them.- Returns:
-
isList
public boolean isList()
-
areParametersAllowed
public boolean areParametersAllowed()
-
-