public static class Window.Group extends Object
The specification is defined by an upper and lower bound, and also has zero or more partitioning columns.
A window is either logical or physical. A physical window is measured in terms of row count. A logical window is measured in terms of rows within a certain distance from the current sort key.
For example:
ROWS BETWEEN 10 PRECEDING and 5 FOLLOWING
is a physical window with an
upper and lower bound;
RANGE BETWEEN INTERVAL '1' HOUR PRECEDING AND UNBOUNDED
FOLLOWING
is a logical window with only a lower bound;
RANGE INTERVAL '10' MINUTES PRECEDING
(which is equivalent to
RANGE BETWEEN INTERVAL '10' MINUTES PRECEDING AND
CURRENT ROW
) is a logical window with an upper and lower bound.
Modifier and Type | Field and Description |
---|---|
com.google.common.collect.ImmutableList<Window.RexWinAggCall> |
aggCalls
List of
Window.RexWinAggCall objects, each of which is a call to a SqlAggFunction . |
boolean |
isRows |
org.apache.calcite.util.ImmutableBitSet |
keys |
org.apache.calcite.rex.RexWindowBound |
lowerBound |
org.apache.calcite.rel.RelCollation |
orderKeys |
org.apache.calcite.rex.RexWindowBound |
upperBound |
Constructor and Description |
---|
Group(org.apache.calcite.util.ImmutableBitSet keys,
boolean isRows,
org.apache.calcite.rex.RexWindowBound lowerBound,
org.apache.calcite.rex.RexWindowBound upperBound,
org.apache.calcite.rel.RelCollation orderKeys,
List<Window.RexWinAggCall> aggCalls) |
Modifier and Type | Method and Description |
---|---|
org.apache.calcite.rel.RelCollation |
collation() |
boolean |
equals(Object obj) |
List<org.apache.calcite.rel.core.AggregateCall> |
getAggregateCalls(Window windowRel)
Presents a view of the
Window.RexWinAggCall list as a list of AggregateCall . |
int |
hashCode() |
boolean |
isAlwaysNonEmpty()
Returns if the window is guaranteed to have rows.
|
String |
toString() |
public final org.apache.calcite.util.ImmutableBitSet keys
public final boolean isRows
public final org.apache.calcite.rex.RexWindowBound lowerBound
public final org.apache.calcite.rex.RexWindowBound upperBound
public final org.apache.calcite.rel.RelCollation orderKeys
public final com.google.common.collect.ImmutableList<Window.RexWinAggCall> aggCalls
Window.RexWinAggCall
objects, each of which is a call to a SqlAggFunction
.public Group(org.apache.calcite.util.ImmutableBitSet keys, boolean isRows, org.apache.calcite.rex.RexWindowBound lowerBound, org.apache.calcite.rex.RexWindowBound upperBound, org.apache.calcite.rel.RelCollation orderKeys, List<Window.RexWinAggCall> aggCalls)
public org.apache.calcite.rel.RelCollation collation()
public boolean isAlwaysNonEmpty()
SqlWindow.isAlwaysNonEmpty()
,
SqlOperatorBinding.getGroupCount()
,
SqlValidatorImpl.resolveWindow(org.apache.calcite.sql.SqlNode,
org.apache.calcite.sql.validate.SqlValidatorScope)
public List<org.apache.calcite.rel.core.AggregateCall> getAggregateCalls(Window windowRel)
Window.RexWinAggCall
list as a list of AggregateCall
.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.