MCPcopy Create free account
hub / github.com/apache/datafusion / calculate_range

Method calculate_range

datafusion/expr/src/window_state.rs:156–188  ·  view source on GitHub ↗

This function calculates beginning/ending indices for the frame of the current row.

(
        &mut self,
        range_columns: &[ArrayRef],
        last_range: &Range<usize>,
        length: usize,
        idx: usize,
    )

Source from the content-addressed store, hash-verified

154
155 /// This function calculates beginning/ending indices for the frame of the current row.
156 pub fn calculate_range(
157 &mut self,
158 range_columns: &[ArrayRef],
159 last_range: &Range<usize>,
160 length: usize,
161 idx: usize,
162 ) -> Result<Range<usize>> {
163 match self {
164 WindowFrameContext::Rows(window_frame) => {
165 Self::calculate_range_rows(window_frame, length, idx)
166 }
167 // Sort options is used in RANGE mode calculations because the
168 // ordering or position of NULLs impact range calculations and
169 // comparison of rows.
170 WindowFrameContext::Range {
171 window_frame,
172 state,
173 } => state.calculate_range(
174 window_frame,
175 last_range,
176 range_columns,
177 length,
178 idx,
179 ),
180 // Sort options is not used in GROUPS mode calculations as the
181 // inequality of two rows indicates a group change, and ordering
182 // or position of NULLs do not impact inequality.
183 WindowFrameContext::Groups {
184 window_frame,
185 state,
186 } => state.calculate_range(window_frame, range_columns, length, idx),
187 }
188 }
189
190 /// This function calculates beginning/ending indices for the frame of the current row.
191 fn calculate_range_rows(

Callers 2

assert_group_rangesFunction · 0.45
assert_frame_rangesFunction · 0.45

Calls 1

is_nullMethod · 0.45

Tested by

no test coverage detected