| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| protected Window | over
OVER clause |
| protected SortOrder | overOrderBySort
Sort order for OVER |
| protected final Select | select
SELECT |
| public static final int | STAGE_GROUP
Group stage, used for explicit or implicit GROUP BY operation. |
| public static final int | STAGE_RESET
Reset stage. |
| public static final int | STAGE_WINDOW
Window processing stage. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected StringBuilder | Returns: the builder objectstring builder builder, int formatting flags sqlFlags, boolean whether synthetic ORDER BY clause should be generated when it
is missing forceOrderBy)Used to create SQL for the OVER and FILTER clauses. |
| private void | |
| protected abstract Object | Returns: aggregate-specific data object.Create aggregate data object specific to the subclass. |
| protected static SortOrder | Returns: the SortOrderdatabase session session, ArrayList<QueryOrderBy> array of order by expressions orderBy, int index offset offset)Create sort order. |
| protected abstract Value | Returns: aggregated value.the session session, Object the aggregate data aggregateData)Returns aggregated value. |
| protected Object | Returns: group data objectthe collector object groupData, boolean if true, return null if object not found, if false, return new
object if nothing found ifExists)Get the aggregate group data object from the collector object. |
| protected abstract int | Returns: the number of expressionsReturns the number of expressions, excluding OVER clause. |
| private int | Returns: the number of window frame expressionsReturns the number of window frame expressions. |
| private Value | getOrderedResult(SessionLocal session, SelectGroups groupData, PartitionData partition, Object data)
|
| protected abstract void | getOrderedResultLoop(SessionLocal
the session session, HashMap<Integer, Value> the map to append result to result, ArrayList<Value[]> ordered data ordered, int the index of row id value rowIdColumn)Returns result of this window function or window aggregate. |
| public Window | |
| protected SortOrder | |
| public Value | getValue(SessionLocal
the session session)Implements abstract org. Return the resulting value for the current row. |
| protected Object | Returns: the aggregate data object, specific to each kind of aggregate.database session session, SelectGroups aggregate group data groupData, boolean true if this is for ORDER BY forOrderBy)Get the aggregate data for a window clause. |
| private Value | Returns: result of this functionthe session session, SelectGroups the group data groupData)Returns result of this window function or window aggregate. |
| public abstract boolean | Returns: true if this is an aggregate function (including aggregates with OVER clause), false if this is a window functionChecks whether this expression is an aggregate function. |
| public boolean | isEverything(ExpressionVisitor
the visitor visitor)Implements abstract org. Check if this expression and all sub-expressions can fulfill a criteria. |
| public final void | mapColumns(ColumnResolver
the column resolver resolver, int the subquery nesting level level, int current state for nesting checks, initial value is
state)MAP_INITIALImplements abstract org. Map the columns of the resolver to expression columns. |
| protected void | mapColumnsAnalysis(ColumnResolver
the column resolver resolver, int the subquery nesting level level, int one of the Expression MAP_IN_* values innerState)Map the columns of the resolver to expression columns. |
| public Expression | optimize(SessionLocal
the session session)Implements abstract org. Try to optimize the expression. |
| protected abstract void | rememberExpressions(SessionLocal
the session session, Value[] array to store values of expressions array)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)Implements abstract org. Tell the expression columns whether the table filter can return values now. |
| public void | |
| public final void | updateAggregate(SessionLocal
the session session, int select stage stage)Implements abstract org. Update an aggregate value. |
| protected abstract void | updateAggregate(SessionLocal
the database session session, SelectGroups data for the aggregate group groupData, int row id of group groupRowId)Update a row of an aggregate. |
| protected void | updateGroupAggregates(SessionLocal
the session session, int select stage stage)Invoked when processing group stage of grouped window queries to update arguments of this aggregate. |
| protected void | updateOrderedAggregate(SessionLocal
the database session session, SelectGroups data for the aggregate group groupData, int row id of group groupRowId, ArrayList<QueryOrderBy> list of order by expressions orderBy)Update a row of an ordered aggregate. |
| lastGroupRowId | back to summary |
|---|---|
| private int lastGroupRowId | |
| numFrameExpressions | back to summary |
|---|---|
| private int numFrameExpressions | |
| over | back to summary |
|---|---|
| protected Window over OVER clause | |
| overOrderBySort | back to summary |
|---|---|
| protected SortOrder overOrderBySort Sort order for OVER | |
| select | back to summary |
|---|---|
| protected final Select select SELECT | |
| STAGE_GROUP | back to summary |
|---|---|
| public static final int STAGE_GROUP Group stage, used for explicit or implicit GROUP BY operation. | |
| STAGE_RESET | back to summary |
|---|---|
| public static final int STAGE_RESET Reset stage. Used to reset internal data to its initial state. | |
| STAGE_WINDOW | back to summary |
|---|---|
| public static final int STAGE_WINDOW Window processing stage. | |
| DataAnalysisOperation | back to summary |
|---|---|
| protected DataAnalysisOperation(Select select) | |
| appendTailConditions | back to summary |
|---|---|
| protected StringBuilder appendTailConditions(StringBuilder builder, int sqlFlags, boolean forceOrderBy) Used to create SQL for the OVER and FILTER clauses.
| |
| checkOrderBy | back to summary |
|---|---|
| private void checkOrderBy(WindowFrameUnits units, int orderBySize) | |
| createAggregateData | back to summary |
|---|---|
| protected abstract Object createAggregateData() Create aggregate data object specific to the subclass.
| |
| createOrder | back to summary |
|---|---|
| protected static SortOrder createOrder(SessionLocal session, ArrayList<QueryOrderBy> orderBy, int offset) Create sort order.
| |
| getAggregatedValue | back to summary |
|---|---|
| protected abstract Value getAggregatedValue(SessionLocal session, Object aggregateData) Returns aggregated value.
| |
| getGroupData | back to summary |
|---|---|
| protected Object getGroupData(SelectGroups groupData, boolean ifExists) Get the aggregate group data object from the collector object.
| |
| getNumExpressions | back to summary |
|---|---|
| protected abstract int getNumExpressions() Returns the number of expressions, excluding OVER clause.
| |
| getNumFrameExpressions | back to summary |
|---|---|
| private int getNumFrameExpressions() Returns the number of window frame expressions.
| |
| getOrderedResult | back to summary |
|---|---|
| private Value getOrderedResult(SessionLocal session, SelectGroups groupData, PartitionData partition, Object data) | |
| getOrderedResultLoop | back to summary |
|---|---|
| protected abstract void getOrderedResultLoop(SessionLocal session, HashMap<Integer, Value> result, ArrayList<Value[]> ordered, int rowIdColumn) Returns result of this window function or window aggregate. This method may not be called on window aggregate without window order clause. | |
| getOverCondition | back to summary |
|---|---|
| public Window getOverCondition() Returns the OVER condition.
| |
| getOverOrderBySort | back to summary |
|---|---|
| protected SortOrder getOverOrderBySort() Returns the sort order for OVER clause.
| |
| getValue | back to summary |
|---|---|
| public Value getValue(SessionLocal session) Implements abstract org. Doc from org. Return the resulting value for the current row.
| |
| getWindowData | back to summary |
|---|---|
| protected Object getWindowData(SessionLocal session, SelectGroups groupData, boolean forOrderBy) Get the aggregate data for a window clause.
| |
| getWindowResult | back to summary |
|---|---|
| private Value getWindowResult(SessionLocal session, SelectGroups groupData) Returns result of this window function or window aggregate. This method is not used for plain aggregates.
| |
| isAggregate | back to summary |
|---|---|
| public abstract boolean isAggregate() Checks whether this expression is an aggregate function.
| |
| isEverything | back to summary |
|---|---|
| public boolean isEverything(ExpressionVisitor visitor) Implements abstract 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.
| |
| mapColumns | back to summary |
|---|---|
| public final void mapColumns(ColumnResolver resolver, int level, int state) Implements abstract org. Doc from org. Map the columns of the resolver to expression columns.
| |
| mapColumnsAnalysis | back to summary |
|---|---|
| protected void mapColumnsAnalysis(ColumnResolver resolver, int level, int innerState) Map the columns of the resolver to expression columns.
| |
| optimize | back to summary |
|---|---|
| public Expression optimize(SessionLocal session) Implements abstract org. Doc from org. Try to optimize the expression.
| |
| rememberExpressions | back to summary |
|---|---|
| protected abstract void rememberExpressions(SessionLocal session, Value[] array) Stores current values of expressions into the specified array.
| |
| setEvaluatable | back to summary |
|---|---|
| public void setEvaluatable(TableFilter tableFilter, boolean b) Implements abstract org. Doc from org. Tell the expression columns whether the table filter can return values now. This is used when optimizing the query.
| |
| setOverCondition | back to summary |
|---|---|
| public void setOverCondition(Window over) Sets the OVER condition.
| |
| updateAggregate | back to summary |
|---|---|
| public final void updateAggregate(SessionLocal session, int stage) Implements abstract org. Doc from org. Update an aggregate value. This method is called at statement execution time. It is usually called once for each row, but if the expression is used multiple times (for example in the column list, and as part of the HAVING expression) it is called multiple times - the row counter needs to be used to make sure the internal state is only updated once.
| |
| updateAggregate | back to summary |
|---|---|
| protected abstract void updateAggregate(SessionLocal session, SelectGroups groupData, int groupRowId) Update a row of an aggregate.
| |
| updateGroupAggregates | back to summary |
|---|---|
| protected void updateGroupAggregates(SessionLocal session, int stage) Invoked when processing group stage of grouped window queries to update arguments of this aggregate.
| |
| updateOrderedAggregate | back to summary |
|---|---|
| protected void updateOrderedAggregate(SessionLocal session, SelectGroups groupData, int groupRowId, ArrayList<QueryOrderBy> orderBy) Update a row of an ordered aggregate.
| |