mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
change supportsPrewhere() of table engine Buffer and return its destination_table supportsPrewhere() or not
This commit is contained in:
parent
94b74ff4a3
commit
80e37baff8
@ -74,7 +74,15 @@ public:
|
||||
void rename(const String & /*new_path_to_db*/, const String & /*new_database_name*/, const String & new_table_name) override { name = new_table_name; }
|
||||
|
||||
bool supportsSampling() const override { return true; }
|
||||
bool supportsPrewhere() const override { return false; }
|
||||
bool supportsPrewhere() const override
|
||||
{
|
||||
if (no_destination)
|
||||
return false;
|
||||
auto dest = global_context.tryGetTable(destination_database, destination_table);
|
||||
if (dest && dest.get() != this)
|
||||
return dest->supportsPrewhere();
|
||||
return false;
|
||||
}
|
||||
bool supportsFinal() const override { return true; }
|
||||
bool supportsIndexForIn() const override { return true; }
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
1
|
6
dbms/tests/queries/0_stateless/00910_buffer_prewhere.sql
Normal file
6
dbms/tests/queries/0_stateless/00910_buffer_prewhere.sql
Normal file
@ -0,0 +1,6 @@
|
||||
DROP DATABASE IF EXISTS test_buffer;
|
||||
CREATE DATABASE test_buffer;
|
||||
CREATE TABLE test_buffer.mt (uid UInt64, ts DateTime, val Float64) ENGINE = MergeTree PARTITION BY toDate(ts) ORDER BY (uid, ts);
|
||||
CREATE TABLE test_buffer.buf as test_buffer.mt ENGINE = Buffer(test_buffer, mt, 2, 10, 60, 10000, 100000, 1000000, 10000000);
|
||||
INSERT INTO test_buffer.buf VALUES (1, '2019-03-01 10:00:00', 0.5), (2, '2019-03-02 10:00:00', 0.15), (1, '2019-03-03 10:00:00', 0.25)
|
||||
SELECT count() from test_buffer.buf prewhere ts > toDateTime('2019-03-01 12:00:00') and ts < toDateTime('2019-03-02 12:00:00')
|
Loading…
Reference in New Issue
Block a user