Interface WinAggFrameContext
- All Known Subinterfaces:
WinAggAddContext
,WinAggFrameResultContext
,WinAggResetContext
,WinAggResultContext
- All Known Implementing Classes:
WinAggAddContextImpl
,WinAggResetContextImpl
,WinAggResultContextImpl
public interface WinAggFrameContext
Provides information on the current window.
All the indexes are ready to be used in
WinAggResultContext.arguments(org.apache.calcite.linq4j.tree.Expression)
,
WinAggFrameResultContext.rowTranslator(org.apache.calcite.linq4j.tree.Expression)
and similar methods.
-
Method Summary
Modifier 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.
-
Method Details
-
index
Expression index()Returns the index of the current row in the partition. In other words, it is close to ~ROWS BETWEEN CURRENT ROW. Note to usestartIndex()
when you need zero-based row position.- Returns:
- the index of the very first row in partition
-
startIndex
Expression startIndex()Returns the index of the very first row in partition.- Returns:
- index of the very first row in partition
-
endIndex
Expression endIndex()Returns the index of the very last row in partition.- Returns:
- index of the very last row in partition
-
hasRows
Expression hasRows()Returns 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.- Returns:
- boolean expression that tells if the partition has rows
-
getFrameRowCount
Expression getFrameRowCount()Returns the number of rows in the current frame (subject to framing clause).- Returns:
- number of rows in the current partition or 0 if the partition is empty
-
getPartitionRowCount
Expression getPartitionRowCount()Returns the number of rows in the current partition (as determined by PARTITION BY clause).- Returns:
- number of rows in the current partition or 0 if the partition is empty
-