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, exclusion clause, 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 FOLLOWINGis a physical window with an upper and lower bound;RANGE BETWEEN INTERVAL '1' HOUR PRECEDING AND UNBOUNDED FOLLOWINGis 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
FieldsModifier and TypeFieldDescriptionfinal com.google.common.collect.ImmutableList<Window.RexWinAggCall>List ofWindow.RexWinAggCallobjects, each of which is a call to aSqlAggFunction.final RexWindowExclusionfinal booleanfinal ImmutableBitSetfinal RexWindowBoundfinal RelCollationfinal RexWindowBound -
Constructor Summary
ConstructorsConstructorDescriptionGroup(ImmutableBitSet keys, boolean isRows, RexWindowBound lowerBound, RexWindowBound upperBound, RexWindowExclusion exclude, RelCollation orderKeys, List<Window.RexWinAggCall> aggCalls) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAggregateCalls(Window windowRel) Presents a view of theWindow.RexWinAggCalllist as a list ofAggregateCall.inthashCode()booleanReturns if the window is guaranteed to have rows.toString()
-
Field Details
-
keys
-
isRows
public final boolean isRows -
lowerBound
-
upperBound
-
exclude
-
orderKeys
-
aggCalls
List ofWindow.RexWinAggCallobjects, each of which is a call to aSqlAggFunction.
-
-
Constructor Details
-
Group
public Group(ImmutableBitSet keys, boolean isRows, RexWindowBound lowerBound, RexWindowBound upperBound, RexWindowExclusion exclude, 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.RexWinAggCalllist as a list ofAggregateCall.
-