public class WindowFunction extends DataAnalysisOperation
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| 构造器和说明 |
|---|
WindowFunction(WindowFunctionType type,
Select select,
Expression[] args)
Creates new instance of a window function.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected Object |
createAggregateData()
Create aggregate data object specific to the subclass.
|
protected Value |
getAggregatedValue(SessionLocal session,
Object aggregateData)
Returns aggregated value.
|
int |
getCost()
Estimate the cost to process the expression.
|
WindowFunctionType |
getFunctionType()
Returns the type of this function.
|
static int |
getMaxArgumentCount(WindowFunctionType type)
Returns maximal number of arguments for the specified type.
|
static int |
getMinArgumentCount(WindowFunctionType type)
Returns minimal number of arguments for the specified type.
|
protected int |
getNumExpressions()
Returns the number of expressions, excluding OVER clause.
|
protected void |
getOrderedResultLoop(SessionLocal session,
HashMap<Integer,Value> result,
ArrayList<Value[]> ordered,
int rowIdColumn)
Returns result of this window function or window aggregate.
|
TypeInfo |
getType()
Returns the data type.
|
StringBuilder |
getUnenclosedSQL(StringBuilder builder,
int sqlFlags)
Get the SQL statement of this expression.
|
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.
|
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 |
setFromLast(boolean fromLast)
Sets FROM FIRST or FROM LAST clause value.
|
void |
setIgnoreNulls(boolean ignoreNulls)
Sets RESPECT NULLS or IGNORE NULLS clause value.
|
protected void |
updateAggregate(SessionLocal session,
SelectGroups groupData,
int groupRowId)
Update a row of an aggregate.
|
protected void |
updateGroupAggregates(SessionLocal session,
int stage)
Invoked when processing group stage of grouped window queries to update
arguments of this aggregate.
|
appendTailConditions, createOrder, getGroupData, getOverCondition, getOverOrderBySort, getValue, getWindowData, isEverything, mapColumns, setOverCondition, updateAggregate, updateOrderedAggregateaddFilterConditions, createIndexConditions, getAlias, getBooleanValue, getColumnName, getColumnNameForView, getEnclosedSQL, getNonAliasExpression, getNotIfPossible, getNullable, getSchemaName, getSQL, getSQL, getSQL, getSQL, getSubexpression, getSubexpressionCount, getTableAlias, getTableName, getWhenSQL, getWhenValue, isConstant, isIdentity, isNullConstant, isValueSet, isWhenConditionOperand, needParentheses, optimizeCondition, toString, writeExpressions, writeExpressionsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic WindowFunction(WindowFunctionType type, Select select, Expression[] args)
type - the typeselect - the select statementargs - arguments, or nullpublic static int getMinArgumentCount(WindowFunctionType type)
type - the type of a window functionpublic static int getMaxArgumentCount(WindowFunctionType type)
type - the type of a window functionpublic WindowFunctionType getFunctionType()
public void setFromLast(boolean fromLast)
fromLast - whether FROM LAST clause was specified.public void setIgnoreNulls(boolean ignoreNulls)
ignoreNulls - whether IGNORE NULLS clause was specifiedpublic boolean isAggregate()
DataAnalysisOperationisAggregate 在类中 DataAnalysisOperationprotected void updateAggregate(SessionLocal session, SelectGroups groupData, int groupRowId)
DataAnalysisOperationupdateAggregate 在类中 DataAnalysisOperationsession - the database sessiongroupData - data for the aggregate groupgroupRowId - row id of groupprotected void updateGroupAggregates(SessionLocal session, int stage)
DataAnalysisOperationupdateGroupAggregates 在类中 DataAnalysisOperationsession - the sessionstage - select stageprotected int getNumExpressions()
DataAnalysisOperationgetNumExpressions 在类中 DataAnalysisOperationprotected void rememberExpressions(SessionLocal session, Value[] array)
DataAnalysisOperationrememberExpressions 在类中 DataAnalysisOperationsession - the sessionarray - array to store values of expressionsprotected Object createAggregateData()
DataAnalysisOperationcreateAggregateData 在类中 DataAnalysisOperationprotected 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 Value getAggregatedValue(SessionLocal session, Object aggregateData)
DataAnalysisOperationgetAggregatedValue 在类中 DataAnalysisOperationsession - the sessionaggregateData - the aggregate datapublic 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 valuepublic TypeInfo getType()
ExpressiongetType 在接口中 TypedgetType 在类中 Expressionpublic StringBuilder getUnenclosedSQL(StringBuilder builder, int sqlFlags)
ExpressiongetUnenclosedSQL 在类中 Expressionbuilder - string buildersqlFlags - formatting flagspublic int getCost()
ExpressiongetCost 在类中 ExpressionCopyright © 2022. All rights reserved.