Package org.apache.calcite.rel.core
Class Window.Group
java.lang.Object
org.apache.calcite.rel.core.Window.Group
- Enclosing class:
Window
Group of windowed aggregate calls that have the same window specification.
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 toRANGE BETWEEN INTERVAL '10' MINUTES PRECEDING AND CURRENT ROW
) is a logical window with an upper and lower bound.
-
Field Summary
Modifier and TypeFieldDescriptionfinal com.google.common.collect.ImmutableList<Window.RexWinAggCall>
List ofWindow.RexWinAggCall
objects, each of which is a call to aSqlAggFunction
.final boolean
final ImmutableBitSet
final RexWindowBound
final RelCollation
final RexWindowBound
-
Constructor Summary
ConstructorDescriptionGroup
(ImmutableBitSet keys, boolean isRows, RexWindowBound lowerBound, RexWindowBound upperBound, RelCollation orderKeys, List<Window.RexWinAggCall> aggCalls) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAggregateCalls
(Window windowRel) Presents a view of theWindow.RexWinAggCall
list as a list ofAggregateCall
.int
hashCode()
boolean
Returns if the window is guaranteed to have rows.toString()
-
Field Details
-
keys
-
isRows
public final boolean isRows -
lowerBound
-
upperBound
-
orderKeys
-
aggCalls
List ofWindow.RexWinAggCall
objects, each of which is a call to aSqlAggFunction
.
-
-
Constructor Details
-
Group
public Group(ImmutableBitSet keys, boolean isRows, RexWindowBound lowerBound, RexWindowBound upperBound, RelCollation orderKeys, List<Window.RexWinAggCall> aggCalls)
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
collation
-
isAlwaysNonEmpty
public boolean isAlwaysNonEmpty()Returns if the window is guaranteed to have rows. This is useful to refine data type of window aggregates. For instance sum(non-nullable) over (empty window) is NULL.- Returns:
- true when the window is non-empty
- See Also:
-
getAggregateCalls
Presents a view of theWindow.RexWinAggCall
list as a list ofAggregateCall
.
-