-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[bugfix](light weight schema change) support delete condition in schema change #11869
Conversation
{ | ||
std::shared_lock rdlock(tablet->get_header_lock()); | ||
std::copy(tablet->delete_predicates().cbegin(), tablet->delete_predicates().cend(), | ||
std::inserter(reader_params.delete_predicates, | ||
reader_params.delete_predicates.begin())); | ||
} | ||
|
||
TabletSchemaSPtr merge_tablet_schema = std::make_shared<TabletSchema>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't repeat yourself. same as the line 50, maybe we need a function
@@ -201,10 +202,10 @@ class TabletReader { | |||
std::vector<bool> _is_lower_keys_included; | |||
std::vector<bool> _is_upper_keys_included; | |||
// contains condition on key columns in agg or unique table or all column in dup tables | |||
Conditions _conditions; | |||
std::unique_ptr<Conditions> _conditions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change unique_ptr, need more malloc
operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I change tablet schema as a parameter in Conditions constructor and remove set tablet schema method because the condtion should always have a tablet schema and should not be changed. But tablet schema is not required in reader's constructor.
@@ -233,8 +233,6 @@ class RowsetMeta { | |||
|
|||
bool delete_flag() const { return _rowset_meta_pb.delete_flag(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this code useless also ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, it is useless. Because it is never be set, but collector depend on it and many logic depend on it, I do not know the meaning of the flag.
10c3a94
to
f250b95
Compare
LGTM |
3990977
to
bb49fba
Compare
df5af07
to
75e3b80
Compare
LGTM |
return (*it)->tablet_schema(); | ||
} | ||
++it; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_rs_version_map in Tablet is much more efficient.
@@ -537,7 +537,7 @@ bool CondColumn::eval(const segment_v2::BloomFilter* bf) const { | |||
|
|||
Status Conditions::append_condition(const TCondition& tcond) { | |||
DCHECK(_schema != nullptr); | |||
int32_t index = _schema->field_index(tcond.column_name); | |||
int32_t index = _schema->field_index(tcond.column_unique_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we hide index in the TabletSchema? We can use a function like this _schema->get_clolumn_by_unique_id(tcond.column_unique_id).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
…ma change (apache#11869) * [bugfix](light weight schema change) support delete condition in schema change Co-authored-by: yiguolei <yiguolei@gmail.com>
Proposed changes
This is part of #10136
This PR also decouple delete hander from reader.
Problem summary
Describe your changes.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...