Class WinAggResetContextImpl
java.lang.Object
org.apache.calcite.adapter.enumerable.NestedBlockBuilderImpl
org.apache.calcite.adapter.enumerable.impl.AggResetContextImpl
org.apache.calcite.adapter.enumerable.impl.WinAggResetContextImpl
- All Implemented Interfaces:
- AggResetContext,- NestedBlockBuilder,- WinAggFrameContext,- WinAggResetContext
Implementation of
 
WinAggResetContext.- 
Constructor SummaryConstructorsConstructorDescriptionWinAggResetContextImpl(BlockBuilder block, List<Expression> accumulator, Expression index, Expression startIndex, Expression endIndex, Expression hasRows, Expression frameRowCount, Expression partitionRowCount) Creates window aggregate reset context.
- 
Method SummaryModifier and TypeMethodDescriptionendIndex()Returns the index of the very last row in partition.Returns the number of rows in the current frame (subject to framing clause).Returns the number of rows in the current partition (as determined by PARTITION BY clause).hasRows()Returns the boolean expression that tells if the partition has rows.index()Returns the index of the current row in the partition.Returns the index of the very first row in partition.Methods inherited from class org.apache.calcite.adapter.enumerable.impl.AggResetContextImplaccumulator, callMethods inherited from class org.apache.calcite.adapter.enumerable.NestedBlockBuilderImplcurrentBlock, exitBlock, nestBlock, nestBlockMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.calcite.adapter.enumerable.AggResetContextaccumulatorMethods inherited from interface org.apache.calcite.adapter.enumerable.NestedBlockBuildercurrentBlock, exitBlock, nestBlock, nestBlock
- 
Constructor Details- 
WinAggResetContextImplpublic WinAggResetContextImpl(BlockBuilder block, List<Expression> accumulator, Expression index, Expression startIndex, Expression endIndex, Expression hasRows, Expression frameRowCount, Expression partitionRowCount) Creates window aggregate reset context.- Parameters:
- block- code block that will contain the added initialization
- accumulator- accumulator variables that store the intermediate aggregate state
- index- index of the current row in the partition
- startIndex- index of the very first row in partition
- endIndex- index of the very last row in partition
- hasRows- boolean expression that tells if the partition has rows
- frameRowCount- number of rows in the current frame
- partitionRowCount- number of rows in the current partition
 
 
- 
- 
Method Details- 
indexDescription copied from interface:WinAggFrameContextReturns the index of the current row in the partition. In other words, it is close to ~ROWS BETWEEN CURRENT ROW. Note to useWinAggFrameContext.startIndex()when you need zero-based row position.- Specified by:
- indexin interface- WinAggFrameContext
- Returns:
- the index of the very first row in partition
 
- 
startIndexDescription copied from interface:WinAggFrameContextReturns the index of the very first row in partition.- Specified by:
- startIndexin interface- WinAggFrameContext
- Returns:
- index of the very first row in partition
 
- 
endIndexDescription copied from interface:WinAggFrameContextReturns the index of the very last row in partition.- Specified by:
- endIndexin interface- WinAggFrameContext
- Returns:
- index of the very last row in partition
 
- 
hasRowsDescription copied from interface:WinAggFrameContextReturns the boolean expression that tells if the partition has rows. The partition might lack rows in cases like ROWS BETWEEN 1000 PRECEDING AND 900 PRECEDING.- Specified by:
- hasRowsin interface- WinAggFrameContext
- Returns:
- boolean expression that tells if the partition has rows
 
- 
getFrameRowCountDescription copied from interface:WinAggFrameContextReturns the number of rows in the current frame (subject to framing clause).- Specified by:
- getFrameRowCountin interface- WinAggFrameContext
- Returns:
- number of rows in the current partition or 0 if the partition is empty
 
- 
getPartitionRowCountDescription copied from interface:WinAggFrameContextReturns the number of rows in the current partition (as determined by PARTITION BY clause).- Specified by:
- getPartitionRowCountin interface- WinAggFrameContext
- Returns:
- number of rows in the current partition or 0 if the partition is empty
 
 
-