mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Adding support for PREWHERE in live view tables.
This commit is contained in:
parent
ecca78d855
commit
75c97ca82a
@ -26,6 +26,11 @@ public:
|
|||||||
return std::make_shared<StorageBlocks>(table_id, columns, std::move(pipes), to_stage);
|
return std::make_shared<StorageBlocks>(table_id, columns, std::move(pipes), to_stage);
|
||||||
}
|
}
|
||||||
std::string getName() const override { return "Blocks"; }
|
std::string getName() const override { return "Blocks"; }
|
||||||
|
/// It is passed inside the query and solved at its level.
|
||||||
|
bool supportsPrewhere() const override { return true; }
|
||||||
|
bool supportsSampling() const override { return true; }
|
||||||
|
bool supportsFinal() const override { return true; }
|
||||||
|
|
||||||
QueryProcessingStage::Enum getQueryProcessingStage(const Context &, QueryProcessingStage::Enum /*to_stage*/, const ASTPtr &) const override { return to_stage; }
|
QueryProcessingStage::Enum getQueryProcessingStage(const Context &, QueryProcessingStage::Enum /*to_stage*/, const ASTPtr &) const override { return to_stage; }
|
||||||
|
|
||||||
Pipes read(
|
Pipes read(
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
ASTPtr getInnerBlocksQuery();
|
ASTPtr getInnerBlocksQuery();
|
||||||
|
|
||||||
/// It is passed inside the query and solved at its level.
|
/// It is passed inside the query and solved at its level.
|
||||||
|
bool supportsPrewhere() const override { return true; }
|
||||||
bool supportsSampling() const override { return true; }
|
bool supportsSampling() const override { return true; }
|
||||||
bool supportsFinal() const override { return true; }
|
bool supportsFinal() const override { return true; }
|
||||||
|
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
5 1
|
||||||
|
5 1
|
||||||
|
10 2
|
||||||
|
10 2
|
@ -0,0 +1,20 @@
|
|||||||
|
SET allow_experimental_live_view = 1;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS lv;
|
||||||
|
DROP TABLE IF EXISTS mt;
|
||||||
|
|
||||||
|
CREATE TABLE mt (a Int32) Engine=MergeTree order by tuple();
|
||||||
|
CREATE LIVE VIEW lv AS SELECT sum(a) FROM mt PREWHERE a > 1;
|
||||||
|
|
||||||
|
INSERT INTO mt VALUES (1),(2),(3);
|
||||||
|
|
||||||
|
SELECT *,_version FROM lv;
|
||||||
|
SELECT *,_version FROM lv;
|
||||||
|
|
||||||
|
INSERT INTO mt VALUES (1),(2),(3);
|
||||||
|
|
||||||
|
SELECT *,_version FROM lv;
|
||||||
|
SELECT *,_version FROM lv;
|
||||||
|
|
||||||
|
DROP TABLE lv;
|
||||||
|
DROP TABLE mt;
|
Loading…
Reference in New Issue
Block a user