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],
)
| 243 | /// |
| 244 | /// See [`partition`] for more details. |
| 245 | pub 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 |
searching dependent graphs…