public class Aggregate extends AbstractAggregate implements ExpressionWithFlags
args, distinct, filterCondition, typeover, 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| 构造器和说明 |
|---|
Aggregate(AggregateType aggregateType,
Expression[] args,
Select select,
boolean distinct)
Create a new aggregate object.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected Object |
createAggregateData()
Create aggregate data object specific to the subclass.
|
Value |
getAggregatedValue(SessionLocal session,
Object aggregateData)
Returns aggregated value.
|
AggregateType |
getAggregateType()
Returns the type of this aggregate.
|
static AggregateType |
getAggregateType(String name)
Get the aggregate type for this name, or -1 if no aggregate has been
found.
|
int |
getCost()
Estimate the cost to process the expression.
|
Object |
getExtraArguments()
Returns the additional arguments.
|
int |
getFlags()
Returns the flags.
|
protected int |
getNumExpressions()
Returns the number of expressions, excluding OVER clause.
|
Select |
getSelect()
Returns the select statement.
|
StringBuilder |
getUnenclosedSQL(StringBuilder builder,
int sqlFlags)
Get the SQL statement of this expression.
|
Value |
getValue(SessionLocal session)
Return the resulting value for the current row.
|
boolean |
isDistinct()
Returns if distinct is used.
|
boolean |
isEverything(ExpressionVisitor visitor)
Check if this expression and all sub-expressions can fulfill a criteria.
|
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.
|
protected void |
rememberExpressions(SessionLocal session,
Value[] array)
Stores current values of expressions into the specified array.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean b)
Tell the expression columns whether the table filter can return values
now.
|
void |
setExtraArguments(Object extraArguments)
Sets the additional arguments.
|
void |
setFlags(int flags)
Set the flags for this expression.
|
void |
setOrderByList(ArrayList<QueryOrderBy> orderByList)
Set the order for ARRAY_AGG() or GROUP_CONCAT() aggregate.
|
protected void |
updateAggregate(SessionLocal session,
Object aggregateData)
Updates an aggregate value.
|
protected 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.
|
appendTailConditions, getFilterCondition, getOrderedResultLoop, getSubexpression, getSubexpressionCount, getType, isAggregate, setFilterCondition, updateAggregatecreateOrder, getGroupData, getOverCondition, getOverOrderBySort, getWindowData, mapColumns, setOverCondition, updateAggregate, updateOrderedAggregateaddFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getTableAlias, getTableName, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic Aggregate(AggregateType aggregateType, Expression[] args, Select select, boolean distinct)
aggregateType - the aggregate typeargs - the aggregated expressionsselect - the select statementdistinct - if distinct is usedpublic static AggregateType getAggregateType(String name)
name - the aggregate function namepublic void setOrderByList(ArrayList<QueryOrderBy> orderByList)
orderByList - the order by listpublic AggregateType getAggregateType()
public void setExtraArguments(Object extraArguments)
extraArguments - the additional argumentspublic Object getExtraArguments()
public void setFlags(int flags)
ExpressionWithFlagssetFlags 在接口中 ExpressionWithFlagsflags - the flags to setpublic int getFlags()
ExpressionWithFlagsgetFlags 在接口中 ExpressionWithFlagsprotected void updateAggregate(SessionLocal session, Object aggregateData)
AbstractAggregateupdateAggregate 在类中 AbstractAggregatesession - the sessionaggregateData - aggregate dataprotected void updateGroupAggregates(SessionLocal session, int stage)
DataAnalysisOperationupdateGroupAggregates 在类中 AbstractAggregatesession - the sessionstage - select stageprotected int getNumExpressions()
DataAnalysisOperationgetNumExpressions 在类中 DataAnalysisOperationprotected void rememberExpressions(SessionLocal session, Value[] array)
DataAnalysisOperationrememberExpressions 在类中 DataAnalysisOperationsession - the sessionarray - array to store values of expressionsprotected void updateFromExpressions(SessionLocal session, Object aggregateData, Value[] array)
AbstractAggregateupdateFromExpressions 在类中 AbstractAggregatesession - the sessionaggregateData - aggregate dataarray - values of expressionsprotected Object createAggregateData()
DataAnalysisOperationcreateAggregateData 在类中 DataAnalysisOperationpublic Value getValue(SessionLocal session)
ExpressiongetValue 在类中 DataAnalysisOperationsession - the sessionpublic Value getAggregatedValue(SessionLocal session, Object aggregateData)
DataAnalysisOperationgetAggregatedValue 在类中 DataAnalysisOperationsession - the sessionaggregateData - the aggregate datapublic void mapColumnsAnalysis(ColumnResolver resolver, int level, int innerState)
DataAnalysisOperationmapColumnsAnalysis 在类中 AbstractAggregateresolver - the column resolverlevel - the subquery nesting levelinnerState - one of the Expression MAP_IN_* valuespublic Expression optimize(SessionLocal session)
Expressionoptimize 在类中 AbstractAggregatesession - the sessionpublic void setEvaluatable(TableFilter tableFilter, boolean b)
ExpressionsetEvaluatable 在类中 AbstractAggregatetableFilter - the table filterb - true if the table filter can return valuepublic StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags)
ExpressiongetUnenclosedSQL 在类中 Expressionbuilder - string buildersqlFlags - formatting flagspublic boolean isEverything(ExpressionVisitor visitor)
ExpressionisEverything 在类中 DataAnalysisOperationvisitor - the visitorpublic int getCost()
ExpressiongetCost 在类中 Expressionpublic Select getSelect()
public boolean isDistinct()
Copyright © 2022. All rights reserved.