Skip to content

Commit 7bb5d3f

Browse files
committed
comments
1 parent e5012b4 commit 7bb5d3f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

datafusion/expr/src/window_state.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ impl WindowFrameContext {
155155
}
156156
}
157157

158+
/// Refreshes any cached frame comparators for the current batch.
159+
///
160+
/// This is a no-op for `ROWS` and `GROUPS` frames. For `RANGE` frames,
161+
/// callers should invoke this before `calculate_range` when the ORDER BY
162+
/// columns change, such as when evaluating a new batch or partition.
158163
pub fn update_comparators(&mut self, range_columns: &[ArrayRef]) -> Result<()> {
159164
match self {
160165
WindowFrameContext::Range {
@@ -506,6 +511,7 @@ impl WindowRangeComparator {
506511
/// ranges of data while processing RANGE frames.
507512
/// Attribute `sort_options` stores the column ordering specified by the ORDER
508513
/// BY clause. This information is used to calculate the range.
514+
/// Attributes `start_bound_comparator` and `end_bound_comparator` store the cached comparators for calculating ranges.
509515
#[derive(Debug, Default, Clone)]
510516
pub struct WindowFrameStateRange {
511517
sort_options: Vec<SortOptions>,

0 commit comments

Comments
 (0)