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

Function evaluate_partition_ranges

datafusion/common/src/utils/mod.rs:245–261  ·  view source on GitHub ↗

Given a list of 0 or more already sorted columns, finds the partition ranges that would partition equally across columns. See [`partition`] for more details.

(
    num_rows: usize,
    partition_columns: &[SortColumn],
)

Source from the content-addressed store, hash-verified

243///
244/// See [`partition`] for more details.
245pub fn evaluate_partition_ranges(
246 num_rows: usize,
247 partition_columns: &[SortColumn],
248) -> Result<Vec<Range<usize>>> {
249 Ok(if partition_columns.is_empty() {
250 vec![Range {
251 start: 0,
252 end: num_rows,
253 }]
254 } else {
255 let cols: Vec<_> = partition_columns
256 .iter()
257 .map(|x| Arc::clone(&x.values))
258 .collect();
259 partition(&cols)?.ranges()
260 })
261}
262
263/// Wraps identifier string in double quotes, escaping any double quotes in
264/// the identifier by replacing it with two double quotes

Callers 5

evaluateMethod · 0.85
get_slice_pointMethod · 0.85
compute_aggregatesMethod · 0.85

Calls 4

collectMethod · 0.80
is_emptyMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…