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

Deletes: refactored readers process deletes. #3374

Merged
merged 5 commits into from Jul 22, 2022

Conversation

KiterLuc
Copy link
Contributor

This change allows the refactored readers to process deletes conditions.
For regular fragments, the delete conditions are processed only if the
delete timestamp is greater than the fragment start timestamp. For
fragments consolidated with timestamps, the reader needs to generate a
new condition including the timestamp of the delete and apply this
condition to the fragment.


TYPE: IMPROVEMENT
DESC: Deletes: refactored readers process deletes.

This change allows the refactored readers to process deletes conditions.
For regular fragments, the delete conditions are processed only if the
delete timestamp is greater than the fragment start timestamp. For
fragments consolidated with timestamps, the reader needs to generate a
new condition including the timestamp of the delete and apply this
condition to the fragment.

---
TYPE: IMPROVEMENT
DESC: Deletes: refactored readers process deletes.
@KiterLuc KiterLuc requested a review from ypatia July 14, 2022 12:10
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #19343: Deletes: refactored sparse readers applies deletes..

@KiterLuc KiterLuc force-pushed the lr/deletes-refactored-sparse-readers/ch19343 branch from 66c3191 to bff891f Compare July 15, 2022 12:10
@KiterLuc KiterLuc force-pushed the lr/deletes-refactored-sparse-readers/ch19343 branch from bff891f to 201fd15 Compare July 15, 2022 12:12
Copy link
Member

@ihnorton ihnorton left a comment

Choose a reason for hiding this comment

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

Minor questions/comments inline, but LGTM.

tiledb/sm/query/readers/reader_base.h Outdated Show resolved Hide resolved
@@ -182,6 +189,12 @@ class ReaderBase : public StrategyBase {
*/
bool use_timestamps_;

/**
* Boolean, per fragment, to specify that we need to load timestamps for
* deletes. This matches the fragments in 'fragment_metadata_'
Copy link
Member

Choose a reason for hiding this comment

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

We will also need to store this presence information for updates, right? So may be worth putting both in one struct, either now or later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same boolean can/will be used for both.

return make_timestamped_conditions;
}

Status ReaderBase::generate_timestamped_conditions() {
Copy link
Member

Choose a reason for hiding this comment

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

(no change needed now, but:) For testability, we can consider implementing new functions like this as a transforming version (input -> output) , along with a mutating version (this one) which calls the transform. Since the functions inside return Status, can use throw_if_not_ok.

tiledb/sm/query/readers/reader_base.cc Outdated Show resolved Hide resolved
@@ -161,6 +161,13 @@ class ReaderBase : public StrategyBase {
/** The query condition. */
QueryCondition& condition_;
Copy link
Member

Choose a reason for hiding this comment

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

(general comment) I know this is pre-existing code, but seems like it would be clearer if this was held in a std::optional instead of using condition_.empty().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good idea but major change. I'll tackle in a future refactor. https://app.shortcut.com/tiledb-inc/story/19640/make-query-condition-optional

@KiterLuc KiterLuc merged commit ce208da into dev Jul 22, 2022
@KiterLuc KiterLuc deleted the lr/deletes-refactored-sparse-readers/ch19343 branch July 22, 2022 07:53
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.

None yet

2 participants