Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
amosbird committed Mar 1, 2024
1 parent 6407145 commit 0e618ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/Storages/MergeTree/BoolMask.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ struct BoolMask

bool operator==(const BoolMask & other) const { return can_be_true == other.can_be_true && can_be_false == other.can_be_false; }

/// Check if mask is no longer changeable under operation |.
/// Check if mask is no longer changeable under combine.
/// We use this condition to early-exit KeyConditions::check{InRange,After} methods.
bool isComplete(const BoolMask & initial_mask) const
{
if (initial_mask == consider_only_can_be_true)
return can_be_true;
else if (initial_mask == consider_only_can_be_false)
return can_be_false;
return false;
else
return can_be_true && can_be_false;
}

/// Combine check result in different hyperrectangles.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
Expression ((Projection + Before ORDER BY))
AggregatingProjection
Expression (Before GROUP BY)
Filter (WHERE)
ReadFromMergeTree (default.x)
ReadFromPreparedSource (Optimized trivial count)
5
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ drop table if exists x;

create table x (i int) engine MergeTree order by i settings index_granularity = 3;
insert into x select * from numbers(10);
explain select count() from x where (i >= 3 and i <= 6) or i = 7;
select * from (explain select count() from x where (i >= 3 and i <= 6) or i = 7) where explain like '%ReadFromPreparedSource%' or explain like '%ReadFromMergeTree%';
select count() from x where (i >= 3 and i <= 6) or i = 7;

drop table x;

0 comments on commit 0e618ca

Please sign in to comment.