mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix monotonic chain for read-in-order as well.
This commit is contained in:
parent
60488e2391
commit
d7bb006c23
@ -75,7 +75,12 @@ MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG
|
||||
}
|
||||
/// A node from found match may be nullptr.
|
||||
/// It means that node is visited, but no match was found.
|
||||
if (it->second.monotonicity)
|
||||
/// Ignore a match with monotonicity.
|
||||
frame.mapped_children.push_back(nullptr);
|
||||
else
|
||||
frame.mapped_children.push_back(it->second.node);
|
||||
|
||||
}
|
||||
|
||||
if (frame.mapped_children.size() < frame.node->children.size())
|
||||
|
@ -1 +1,5 @@
|
||||
1
|
||||
1
|
||||
-1
|
||||
1
|
||||
-1
|
||||
|
@ -1,4 +1,5 @@
|
||||
DROP TABLE IF EXISTS t0;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
|
||||
CREATE TABLE t0 (c0 Int16, projection h (SELECT min(c0), max(c0), count() GROUP BY -c0)) ENGINE = MergeTree ORDER BY ();
|
||||
|
||||
@ -6,4 +7,10 @@ INSERT INTO t0(c0) VALUES (1);
|
||||
|
||||
SELECT count() FROM t0 GROUP BY gcd(-sign(c0), -c0);
|
||||
|
||||
create table t1 (c0 Int32) engine = MergeTree order by sin(c0);
|
||||
insert into t1 values (-1), (1);
|
||||
select c0 from t1 order by sin(-c0) settings optimize_read_in_order=0;
|
||||
select c0 from t1 order by sin(-c0) settings optimize_read_in_order=1;
|
||||
|
||||
DROP TABLE t0;
|
||||
DROP TABLE t1;
|
||||
|
Loading…
Reference in New Issue
Block a user