public abstract class AbstractAggregate extends DataAnalysisOperation
| 限定符和类型 | 字段和说明 |
|---|---|
protected Expression[] |
args
The arguments.
|
protected boolean |
distinct
is this a DISTINCT aggregate
|
protected Expression |
filterCondition
FILTER condition for aggregate
|
protected TypeInfo |
type
The type of the result.
|
over, overOrderBySort, select, STAGE_GROUP, STAGE_RESET, STAGE_WINDOWAUTO_PARENTHESES, MAP_IN_AGGREGATE, MAP_IN_WINDOW, MAP_INITIAL, WITH_PARENTHESES, WITHOUT_PARENTHESESADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| 限定符和类型 | 方法和说明 |
|---|---|
protected StringBuilder |
appendTailConditions(StringBuilder builder,
int sqlFlags,
boolean forceOrderBy)
Used to create SQL for the OVER and FILTER clauses.
|
Expression |
getFilterCondition()
Returns the FILTER condition.
|
protected void |
getOrderedResultLoop(SessionLocal session,
HashMap<Integer,Value> result,
ArrayList<Value[]> ordered,
int rowIdColumn)
Returns result of this window function or window aggregate.
|
Expression |
getSubexpression(int index)
Returns subexpression with specified index.
|
int |
getSubexpressionCount()
Returns count of subexpressions.
|
TypeInfo |
getType()
Returns the data type.
|
boolean |
isAggregate()
Checks whether this expression is an aggregate function.
|
void |
mapColumnsAnalysis(ColumnResolver resolver,
int level,
int innerState)
Map the columns of the resolver to expression columns.
|
Expression |
optimize(SessionLocal session)
Try to optimize the expression.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Tell the expression columns whether the table filter can return values
now.
|
void |
setFilterCondition(Expression filterCondition)
Sets the FILTER condition.
|
protected abstract void |
updateAggregate(SessionLocal session,
Object aggregateData)
Updates an aggregate value.
|
protected void |
updateAggregate(SessionLocal session,
SelectGroups groupData,
int groupRowId)
Update a row of an aggregate.
|
protected abstract void |
updateFromExpressions(SessionLocal session,
Object aggregateData,
Value[] array)
Updates the provided aggregate data from the remembered expressions.
|
protected void |
updateGroupAggregates(SessionLocal session,
int stage)
Invoked when processing group stage of grouped window queries to update
arguments of this aggregate.
|
createAggregateData, createOrder, getAggregatedValue, getGroupData, getNumExpressions, getOverCondition, getOverOrderBySort, getValue, getWindowData, isEverything, mapColumns, rememberExpressions, setOverCondition, updateAggregate, updateOrderedAggregateaddFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getCost, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getTableAlias, getTableName, getUnenclosedSQL, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLprotected final boolean distinct
protected final Expression[] args
protected Expression filterCondition
protected TypeInfo type
public final boolean isAggregate()
DataAnalysisOperationisAggregate 在类中 DataAnalysisOperationpublic Expression getFilterCondition()
public void setFilterCondition(Expression filterCondition)
filterCondition - FILTER conditionpublic TypeInfo getType()
ExpressiongetType 在接口中 TypedgetType 在类中 Expressionpublic void mapColumnsAnalysis(ColumnResolver resolver, int level, int innerState)
DataAnalysisOperationmapColumnsAnalysis 在类中 DataAnalysisOperationresolver - the column resolverlevel - the subquery nesting levelinnerState - one of the Expression MAP_IN_* valuespublic Expression optimize(SessionLocal session)
Expressionoptimize 在类中 DataAnalysisOperationsession - the sessionpublic void setEvaluatable(TableFilter tableFilter, boolean b)
ExpressionsetEvaluatable 在类中 DataAnalysisOperationtableFilter - the table filterb - true if the table filter can return valueprotected void getOrderedResultLoop(SessionLocal session, HashMap<Integer,Value> result, ArrayList<Value[]> ordered, int rowIdColumn)
DataAnalysisOperationgetOrderedResultLoop 在类中 DataAnalysisOperationsession - the sessionresult - the map to append result toordered - ordered datarowIdColumn - the index of row id valueprotected abstract void updateFromExpressions(SessionLocal session, Object aggregateData, Value[] array)
session - the sessionaggregateData - aggregate dataarray - values of expressionsprotected void updateAggregate(SessionLocal session, SelectGroups groupData, int groupRowId)
DataAnalysisOperationupdateAggregate 在类中 DataAnalysisOperationsession - the database sessiongroupData - data for the aggregate groupgroupRowId - row id of groupprotected abstract void updateAggregate(SessionLocal session, Object aggregateData)
session - the sessionaggregateData - aggregate dataprotected void updateGroupAggregates(SessionLocal session, int stage)
DataAnalysisOperationupdateGroupAggregates 在类中 DataAnalysisOperationsession - the sessionstage - select stageprotected StringBuilder appendTailConditions(StringBuilder builder, int sqlFlags, boolean forceOrderBy)
DataAnalysisOperationappendTailConditions 在类中 DataAnalysisOperationbuilder - string buildersqlFlags - formatting flagsforceOrderBy - whether synthetic ORDER BY clause should be generated when it
is missingpublic int getSubexpressionCount()
ExpressiongetSubexpressionCount 在类中 Expressionpublic Expression getSubexpression(int index)
ExpressiongetSubexpression 在类中 Expressionindex - 0-based indexCopyright © 2022. All rights reserved.