public abstract class Window extends SingleRel
A Window can handle several window aggregate functions, over several partitions, with pre- and post-expressions, and an optional post-filter. Each of the partitions is defined by a partition key (zero or more columns) and a range (logical or physical). The partitions expect the data to be sorted correctly on input to the relational expression.
Each Window.Group has a set of
RexOver objects.
Created by ProjectToWindowRule.
| Modifier and Type | Class and Description |
|---|---|
static class |
Window.Group
Group of windowed aggregate calls that have the same window specification.
|
static class |
Window.RexWinAggCall
A call to a windowed aggregate function.
|
| Modifier and Type | Field and Description |
|---|---|
List<RexLiteral> |
constants |
com.google.common.collect.ImmutableList<Window.Group> |
groups |
digest, id, rowType, traitSet| Constructor and Description |
|---|
Window(RelOptCluster cluster,
RelTraitSet traits,
RelNode child,
List<RexLiteral> constants,
RelDataType rowType,
List<Window.Group> groups)
Creates a window relational expression.
|
| Modifier and Type | Method and Description |
|---|---|
RelOptCost |
computeSelfCost(RelOptPlanner planner)
Returns the cost of this plan (not including children).
|
RelWriter |
explainTerms(RelWriter pw)
Describes the inputs and attributes of this relational expression.
|
static RelCollation |
getCollation(List<RexFieldCollation> collations) |
List<RexLiteral> |
getConstants()
Returns constants that are additional inputs of current relation.
|
static ImmutableIntList |
getProjectOrdinals(List<RexNode> exprs) |
boolean |
isValid(boolean fail)
Returns whether this relational expression is valid.
|
childrenAccept, deriveRowType, getInput, getInputs, getRows, replaceInputaccept, accept, collectVariablesSet, collectVariablesUsed, computeDigest, copy, explain, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getQuery, getRelTypeName, getRowType, getTable, getTraitSet, getVariablesStopped, isDistinct, isKey, metadata, onRegister, recomputeDigest, register, sole, toStringpublic final com.google.common.collect.ImmutableList<Window.Group> groups
public final List<RexLiteral> constants
public Window(RelOptCluster cluster, RelTraitSet traits, RelNode child, List<RexLiteral> constants, RelDataType rowType, List<Window.Group> groups)
cluster - Clusterchild - Input relational expressionconstants - List of constants that are additional inputsrowType - Output row typegroups - Windowspublic boolean isValid(boolean fail)
RelNodeIf assertions are enabled, this method is typically called with
fail = true, as follows:
This signals that the method can throw anassert rel.isValid(true)
AssertionError if it is
not valid.isValid in interface RelNodeisValid in class AbstractRelNodefail - Whether to fail if invalidpublic RelWriter explainTerms(RelWriter pw)
AbstractRelNodesuper.explainTerms, then call the
RelWriterImpl.input(String, RelNode)
and
RelWriterImpl.item(String, Object)
methods for each input and attribute.explainTerms in class SingleRelpw - Plan writerpublic static ImmutableIntList getProjectOrdinals(List<RexNode> exprs)
public static RelCollation getCollation(List<RexFieldCollation> collations)
public List<RexLiteral> getConstants()
public RelOptCost computeSelfCost(RelOptPlanner planner)
RelNodeNOTE jvs 29-Mar-2006: Don't call this method directly. Instead, use
RelMetadataQuery.getNonCumulativeCost(org.apache.calcite.rel.RelNode), which gives plugins a
chance to override the rel's default ideas about cost.
computeSelfCost in interface RelNodecomputeSelfCost in class AbstractRelNodeplanner - Planner for cost calculationCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.