| Modifier and Type | Field and Description |
|---|---|
| private static final int | ADDITIONAL_AVG_SCALE
The additional precision and scale in decimal digits for an AVG aggregate function. |
| private static final int | ADDITIONAL_SUM_PRECISION
The additional result precision in decimal digits for a SUM aggregate function. |
| private static final HashMap | |
| private final AggregateType | |
| private Object | |
| private int | |
| private ArrayList | |
| private SortOrder |
| Access | Constructor and Description |
|---|---|
| public | Aggregate(AggregateType
the aggregate type aggregateType, Expression[] the aggregated expressions args, Select the select statement select, boolean if distinct is used distinct)Create a new aggregate object. |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| private static Value | |
| protected Object | createAggregateData()
Implements abstract org. Create aggregate data object specific to the subclass. |
| public Value | getAggregatedValue(SessionLocal
the session session, Object the aggregate data aggregateData)Implements abstract org. Returns aggregated value. |
| public static AggregateType | Returns: null if no aggregate function has been found, or the aggregate typethe aggregate function name name)Get the aggregate type for this name, or -1 if no aggregate has been found. |
| public AggregateType | |
| private static TypeInfo | |
| public int | getCost()
Implements abstract org. Estimate the cost to process the expression. |
| private static Value | |
| public Object | |
| public int | |
| private Value | |
| private Value | |
| private Value | |
| private StringBuilder | |
| private String | |
| private StringBuilder | |
| private Index | |
| private Value | |
| protected int | getNumExpressions()
Implements abstract org. Returns the number of expressions, excluding OVER clause. |
| private Value | |
| private Value | |
| public Select | |
| private StringBuilder | |
| private StringBuilder | |
| private StringBuilder | |
| private StringBuilder | |
| private static TypeInfo | |
| public StringBuilder | getUnenclosedSQL(StringBuilder
string builder builder, int formatting flags sqlFlags)Implements abstract org. Get the SQL statement of this expression. |
| public Value | getValue(SessionLocal
the session session)Overrides org. Return the resulting value for the current row. |
| private Value | |
| public boolean | |
| public boolean | isEverything(ExpressionVisitor
the visitor visitor)Overrides org. Check if this expression and all sub-expressions can fulfill a criteria. |
| public void | mapColumnsAnalysis(ColumnResolver
the column resolver resolver, int the subquery nesting level level, int one of the Expression MAP_IN_* values innerState)Overrides org. Map the columns of the resolver to expression columns. |
| public Expression | optimize(SessionLocal
the session session)Overrides org. Try to optimize the expression. |
| protected void | rememberExpressions(SessionLocal
the session session, Value[] array to store values of expressions array)Implements abstract org. Stores current values of expressions into the specified array. |
| public void | setEvaluatable(TableFilter
the table filter tableFilter, boolean true if the table filter can return value b)Overrides org. Tell the expression columns whether the table filter can return values now. |
| public void | |
| public void | setFlags(int
the flags to set flags)Implements org. Set the flags for this expression. |
| public void | setOrderByList(ArrayList<QueryOrderBy>
the order by list orderByList)Set the order for ARRAY_AGG() or GROUP_CONCAT() aggregate. |
| private void | |
| protected void | updateAggregate(SessionLocal
the session session, Object aggregate data aggregateData)Implements abstract org. Updates an aggregate value. |
| private Value | |
| private void | |
| protected void | updateFromExpressions(SessionLocal
the session session, Object aggregate data aggregateData, Value[] values of expressions array)Implements abstract org. Updates the provided aggregate data from the remembered expressions. |
| protected void | updateGroupAggregates(SessionLocal
the session session, int select stage stage)Overrides org. Invoked when processing group stage of grouped window queries to update arguments of this aggregate. |
| ADDITIONAL_AVG_SCALE | back to summary |
|---|---|
| private static final int ADDITIONAL_AVG_SCALE The additional precision and scale in decimal digits for an AVG aggregate function. | |
| ADDITIONAL_SUM_PRECISION | back to summary |
|---|---|
| private static final int ADDITIONAL_SUM_PRECISION The additional result precision in decimal digits for a SUM aggregate function. | |
| AGGREGATES | back to summary |
|---|---|
| private static final HashMap<String, AggregateType> AGGREGATES | |
| aggregateType | back to summary |
|---|---|
| private final AggregateType aggregateType | |
| extraArguments | back to summary |
|---|---|
| private Object extraArguments | |
| flags | back to summary |
|---|---|
| private int flags | |
| orderByList | back to summary |
|---|---|
| private ArrayList<QueryOrderBy> orderByList | |
| orderBySort | back to summary |
|---|---|
| private SortOrder orderBySort | |
| Aggregate | back to summary |
|---|---|
| public Aggregate(AggregateType aggregateType, Expression[] args, Select select, boolean distinct) Create a new aggregate object.
| |
| addAggregate | back to summary |
|---|---|
| private static void addAggregate(String name, AggregateType type) | |
| collect | back to summary |
|---|---|
| private static Value collect(SessionLocal session, AggregateDataCollecting c, AggregateData d) | |
| createAggregateData | back to summary |
|---|---|
| protected Object createAggregateData() Implements abstract org. Doc from org. Create aggregate data object specific to the subclass. | |
| getAggregatedValue | back to summary |
|---|---|
| public Value getAggregatedValue(SessionLocal session, Object aggregateData) Implements abstract org. Doc from org. Returns aggregated value.
| |
| getAggregateType | back to summary |
|---|---|
| public static AggregateType getAggregateType(String name) Get the aggregate type for this name, or -1 if no aggregate has been found.
| |
| getAggregateType | back to summary |
|---|---|
| public AggregateType getAggregateType() Returns the type of this aggregate.
| |
| getAvgType | back to summary |
|---|---|
| private static TypeInfo getAvgType(TypeInfo type) | |
| getCost | back to summary |
|---|---|
| public int getCost() Implements abstract org. Doc from org. Estimate the cost to process the expression. Used when optimizing the query, to calculate the query plan with the lowest estimated cost.
| |
| getCumeDist | back to summary |
|---|---|
| private static Value getCumeDist(Value[] ordered, Value arg, Comparator<Value> sort) | |
| getExtraArguments | back to summary |
|---|---|
| public Object getExtraArguments() Returns the additional arguments.
| |
| getFlags | back to summary |
|---|---|
| public int getFlags() Implements org. Doc from org. Returns the flags.
| |
| getHistogram | back to summary |
|---|---|
| private Value getHistogram(SessionLocal session, AggregateData data) | |
| getHypotheticalSet | back to summary |
|---|---|
| private Value getHypotheticalSet(SessionLocal session, AggregateData data) | |
| getListagg | back to summary |
|---|---|
| private Value getListagg(SessionLocal session, AggregateData data) | |
| getListaggError | back to summary |
|---|---|
| private StringBuilder getListaggError(Value[] array, String separator) | |
| getListaggItem | back to summary |
|---|---|
| private String getListaggItem(Value v) | |
| getListaggTruncate | back to summary |
|---|---|
| private StringBuilder getListaggTruncate(Value[] array, String separator, String filter, boolean withoutCount) | |
| getMinMaxColumnIndex | back to summary |
|---|---|
| private Index getMinMaxColumnIndex() | |
| getMode | back to summary |
|---|---|
| private Value getMode(SessionLocal session, AggregateData data) | |
| getNumExpressions | back to summary |
|---|---|
| protected int getNumExpressions() Implements abstract org. Doc from org. Returns the number of expressions, excluding OVER clause.
| |
| getRank | back to summary |
|---|---|
| private Value getRank(Value[] ordered, Value arg, Comparator<Value> sort) | |
| getSecondValue | back to summary |
|---|---|
| private Value getSecondValue(SessionLocal session, Value[] remembered) | |
| getSelect | back to summary |
|---|---|
| public Select getSelect() Returns the select statement.
| |
| getSQLArrayAggregate | back to summary |
|---|---|
| private StringBuilder getSQLArrayAggregate(StringBuilder builder, int sqlFlags) | |
| getSQLJsonArrayAggregate | back to summary |
|---|---|
| private StringBuilder getSQLJsonArrayAggregate(StringBuilder builder, int sqlFlags) | |
| getSQLJsonObjectAggregate | back to summary |
|---|---|
| private StringBuilder getSQLJsonObjectAggregate(StringBuilder builder, int sqlFlags) | |
| getSQLListagg | back to summary |
|---|---|
| private StringBuilder getSQLListagg(StringBuilder builder, int sqlFlags) | |
| getSumType | back to summary |
|---|---|
| private static TypeInfo getSumType(TypeInfo type) | |
| getUnenclosedSQL | back to summary |
|---|---|
| public StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags) Implements abstract org. Doc from org. Get the SQL statement of this expression. This may not always be the original SQL statement, especially after optimization. Enclosing '(' and ')' are never appended.
| |
| getValue | back to summary |
|---|---|
| public Value getValue(SessionLocal session) Overrides org. Doc from org. Return the resulting value for the current row.
| |
| getValueQuick | back to summary |
|---|---|
| private Value getValueQuick(SessionLocal session) | |
| isDistinct | back to summary |
|---|---|
| public boolean isDistinct() Returns if distinct is used.
| |
| isEverything | back to summary |
|---|---|
| public boolean isEverything(ExpressionVisitor visitor) Overrides org. Doc from org. Check if this expression and all sub-expressions can fulfill a criteria. If any part returns false, the result is false.
| |
| mapColumnsAnalysis | back to summary |
|---|---|
| public void mapColumnsAnalysis(ColumnResolver resolver, int level, int innerState) Overrides org. Doc from org. Map the columns of the resolver to expression columns.
| |
| optimize | back to summary |
|---|---|
| public Expression optimize(SessionLocal session) Overrides org. Doc from org. Try to optimize the expression.
| |
| rememberExpressions | back to summary |
|---|---|
| protected void rememberExpressions(SessionLocal session, Value[] array) Implements abstract org. Doc from org. Stores current values of expressions into the specified array.
| |
| setEvaluatable | back to summary |
|---|---|
| public void setEvaluatable(TableFilter tableFilter, boolean b) Overrides org. Doc from org. Tell the expression columns whether the table filter can return values now. This is used when optimizing the query.
| |
| setExtraArguments | back to summary |
|---|---|
| public void setExtraArguments(Object extraArguments) Sets the additional arguments.
| |
| setFlags | back to summary |
|---|---|
| public void setFlags(int flags) Implements org. Doc from org. Set the flags for this expression.
| |
| setOrderByList | back to summary |
|---|---|
| public void setOrderByList(ArrayList<QueryOrderBy> orderByList) Set the order for ARRAY_AGG() or GROUP_CONCAT() aggregate.
| |
| sortWithOrderBy | back to summary |
|---|---|
| private void sortWithOrderBy(Value[] array) | |
| updateAggregate | back to summary |
|---|---|
| protected void updateAggregate(SessionLocal session, Object aggregateData) Implements abstract org. Doc from org. Updates an aggregate value.
| |
| updateCollecting | back to summary |
|---|---|
| private Value updateCollecting(SessionLocal session, Value v, Value[] remembered) | |
| updateData | back to summary |
|---|---|
| private void updateData(SessionLocal session, AggregateData data, Value v, Value[] remembered) | |
| updateFromExpressions | back to summary |
|---|---|
| protected void updateFromExpressions(SessionLocal session, Object aggregateData, Value[] array) Implements abstract org. Doc from org. Updates the provided aggregate data from the remembered expressions.
| |
| updateGroupAggregates | back to summary |
|---|---|
| protected void updateGroupAggregates(SessionLocal session, int stage) Overrides org. Doc from org. Invoked when processing group stage of grouped window queries to update arguments of this aggregate.
| |