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

Make InMemory object store track last modified time for each entry #3782

Closed
gruuya opened this issue Mar 1, 2023 · 3 comments · Fixed by #3796
Closed

Make InMemory object store track last modified time for each entry #3782

gruuya opened this issue Mar 1, 2023 · 3 comments · Fixed by #3796
Labels
enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers help wanted object-store Object Store Interface

Comments

@gruuya
Copy link
Contributor

gruuya commented Mar 1, 2023

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
The InMemory object stores currently spoofs the last_modified field of the fetched ObjectMetas. In some cases, it is important for this value to be correct.

One such case is deducing the DeltaTable version based on a user-provided timestamp in time travel querying—if the last_modified field is wrong the wrong version of the table will be loaded. Admittedly, no one should be using an in-memory store for actual work, but it would still be very handy to have this working for testing.

Describe the solution you'd like
Keep a separate map of last_modified timestamps, and update it on each write call (put, copy, etc.).

Describe alternatives you've considered
Don't use InMem store whenever last_modified field is crucial for the logic.

Additional context
This could be a good first issue.

@gruuya gruuya added the enhancement Any new improvement worthy of a entry in the changelog label Mar 1, 2023
@tustvold
Copy link
Contributor

tustvold commented Mar 1, 2023

Changing storage to be

storage: Arc<RwLock<BTreeMap<Path, (Bytes, DateTime<Utc>)>>>

Makes a lot of sense to me 👍

@gruuya
Copy link
Contributor Author

gruuya commented Mar 2, 2023

Changing storage to be

storage: Arc<RwLock<BTreeMap<Path, (Bytes, DateTime<Utc>)>>>

Makes a lot of sense to me 👍

Agreed, that is indeed more concise!

@tustvold
Copy link
Contributor

label_issue.py automatically added labels {'object-store'} from #3796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Any new improvement worthy of a entry in the changelog good first issue Good for newcomers help wanted object-store Object Store Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants