Skip to content

Commit

Permalink
c
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Nov 12, 2024
1 parent 7e4d8f4 commit 591ae7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/polars-io/src/cloud/polars_object_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ fn merge_ranges(ranges: &[Range<usize>]) -> impl Iterator<Item = (Range<usize>,
};

let should_merge = is_overlapping || {
let leq_existing_chunk_size_dist = new_merged.len().abs_diff(chunk_size)
let leq_current_dist_to_chunk_size = new_merged.len().abs_diff(chunk_size)
<= current_merged_range.len().abs_diff(chunk_size);
let gap_tolerance =
(current_n_bytes.max(range.len()) / 8).clamp(1024 * 1024, 8 * 1024 * 1024);

leq_existing_chunk_size_dist && distance <= gap_tolerance
leq_current_dist_to_chunk_size && distance <= gap_tolerance
};

if should_merge {
Expand Down

0 comments on commit 591ae7d

Please sign in to comment.