public final class Window
extends java.lang.Object
| Constructor and Description |
|---|
Window(java.lang.String parent,
java.util.ArrayList<Expression> partitionBy,
java.util.ArrayList<QueryOrderBy> orderBy,
WindowFrame frame)
Creates a new instance of window clause.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
appendOrderBy(java.lang.StringBuilder builder,
java.util.ArrayList<QueryOrderBy> orderBy,
int sqlFlags,
boolean forceOrderBy)
Appends ORDER BY clause to the specified builder.
|
Value |
getCurrentKey(SessionLocal session)
Returns the key for the current group.
|
java.util.ArrayList<QueryOrderBy> |
getOrderBy()
Returns ORDER BY clause.
|
java.lang.StringBuilder |
getSQL(java.lang.StringBuilder builder,
int sqlFlags,
boolean forceOrderBy)
Appends SQL representation to the specified builder.
|
WindowFrame |
getWindowFrame()
Returns window frame, or null.
|
boolean |
isOrdered()
Returns
true if window ordering clause is specified or ROWS unit
is used. |
void |
mapColumns(ColumnResolver resolver,
int level)
Map the columns of the resolver to expression columns.
|
void |
optimize(SessionLocal session)
Try to optimize the window conditions.
|
void |
setEvaluatable(TableFilter tableFilter,
boolean value)
Tell the expression columns whether the table filter can return values
now.
|
java.lang.String |
toString() |
void |
updateAggregate(SessionLocal session,
int stage)
Update an aggregate value.
|
public Window(java.lang.String parent,
java.util.ArrayList<Expression> partitionBy,
java.util.ArrayList<QueryOrderBy> orderBy,
WindowFrame frame)
parent - name of the parent windowpartitionBy - PARTITION BY clause, or nullorderBy - ORDER BY clause, or nullframe - window frame clause, or nullpublic static void appendOrderBy(java.lang.StringBuilder builder,
java.util.ArrayList<QueryOrderBy> orderBy,
int sqlFlags,
boolean forceOrderBy)
builder - string builderorderBy - ORDER BY clause, or nullsqlFlags - formatting flagsforceOrderBy - whether synthetic ORDER BY clause should be generated when it
is missingpublic void mapColumns(ColumnResolver resolver, int level)
resolver - the column resolverlevel - the subquery nesting levelExpression.mapColumns(ColumnResolver, int, int)public void optimize(SessionLocal session)
session - the sessionpublic void setEvaluatable(TableFilter tableFilter, boolean value)
tableFilter - the table filtervalue - true if the table filter can return valueExpression.setEvaluatable(TableFilter, boolean)public java.util.ArrayList<QueryOrderBy> getOrderBy()
public WindowFrame getWindowFrame()
public boolean isOrdered()
true if window ordering clause is specified or ROWS unit
is used.true if window ordering clause is specified or ROWS unit
is usedpublic Value getCurrentKey(SessionLocal session)
session - sessionpublic java.lang.StringBuilder getSQL(java.lang.StringBuilder builder,
int sqlFlags,
boolean forceOrderBy)
builder - string buildersqlFlags - formatting flagsforceOrderBy - whether synthetic ORDER BY clause should be generated when it
is missingExpression.getSQL(StringBuilder, int, int)public void updateAggregate(SessionLocal session, int stage)
session - the sessionstage - select stageExpression.updateAggregate(SessionLocal, int)public java.lang.String toString()
toString in class java.lang.Object