Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read cache metadata correctly #494

Merged
merged 2 commits into from
Dec 16, 2024
Merged

Conversation

mkaruza
Copy link
Collaborator

@mkaruza mkaruza commented Dec 16, 2024

Currently we will not be able to read cache metadata for files that are bigger than 4GB because we use stoi function. Use stoll instead that will read long long values. Timestamp also needs to be read with stoll.

Currently we will not be able to read cache metadata for files that are
bigger than 4GB because we use stoi function. Use stoll instead that
will read long long values.
@mkaruza mkaruza requested a review from wuputah December 16, 2024 07:43
@@ -264,7 +264,7 @@ DuckdbGetCachedFilesInfos() {
p.path().c_str());
break;
}
cache_info.push_back(CacheFileInfo {metadata_tokens[0], metadata_tokens[1], std::stoi(metadata_tokens[2]),
cache_info.push_back(CacheFileInfo {metadata_tokens[0], metadata_tokens[1], std::stoll(metadata_tokens[2]),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timestamp is also a int64 - we should also stoll(metadata_tokens[3])

@mkaruza mkaruza changed the title Read cache metadata file size correctly Read cache metadata correctly Dec 16, 2024
@mkaruza mkaruza requested a review from Y-- December 16, 2024 09:52
@mkaruza mkaruza merged commit 44b292a into main Dec 16, 2024
5 checks passed
@mkaruza mkaruza deleted the correct-cache-info-file-size-type branch December 16, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants