Skip to content

Commit 023930c

Browse files
MannDPmann-db
andauthored
refactor: do not guess Vec size for checkpoints (#1263)
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md 2. Run `cargo t --all-features --all-targets` to get started testing, and run `cargo fmt`. 3. Ensure you have added or run the appropriate tests for your PR. 4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 5. Be sure to keep the PR description updated to reflect all changes. --> <!-- PR title formatting: This project uses conventional commits: https://www.conventionalcommits.org/ Each PR corresponds to a commit on the `main` branch, with the title of the PR (typically) being used for the commit message on main. In order to ensure proper formatting in the CHANGELOG please ensure your PR title adheres to the conventional commit specification. Examples: - new feature PR: "feat: new API for snapshot.update()" - bugfix PR: "fix: correctly apply DV in read-table example" --> ## What changes are proposed in this pull request? <!-- Please clarify what changes you are proposing and why the changes are needed. The purpose of this section is to outline the changes, why they are needed, and how this PR fixes the issue. If the reason for the change is already explained clearly in an issue, then it does not need to be restated here. 1. If you propose a new API or feature, clarify the use case for a new API or feature. 2. If you fix a bug, you can clarify why it is a bug. --> We do not allocate Vectors with a known capacity for checkpoint handling. - resolves #1255 <!-- Uncomment this section if there are any changes affecting public APIs: ### This PR affects the following public APIs If there are breaking changes, please ensure the `breaking-changes` label gets added by CI, and describe why the changes are needed. Note that _new_ public APIs are not considered breaking. --> ## How was this change tested? <!-- Please make sure to add test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested, ideally via a reproducible test documented in the PR description. --> --------- Co-authored-by: Mann Patel <[email protected]>
1 parent fa64ad2 commit 023930c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

kernel/src/listed_log_files.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,13 @@ impl ListedLogFiles {
242242
start_version: Option<Version>,
243243
end_version: Option<Version>,
244244
) -> DeltaResult<Self> {
245-
// We expect 10 commit files per checkpoint, so start with that size. We could adjust this based
246-
// on config at some point
247-
248245
// TODO: plumb through a log_tail provided by our caller
249246
let log_tail = vec![];
250247
let log_files = list_log_files(storage, log_root, log_tail, start_version, end_version)?;
251248

252249
log_files.process_results(|iter| {
253-
let mut ascending_commit_files = Vec::with_capacity(10);
254-
let mut ascending_compaction_files = Vec::with_capacity(2);
250+
let mut ascending_commit_files = Vec::new();
251+
let mut ascending_compaction_files = Vec::new();
255252
let mut checkpoint_parts = vec![];
256253
let mut latest_crc_file: Option<ParsedLogPath> = None;
257254

0 commit comments

Comments
 (0)