This commit is contained in:
Alexey Milovidov 2015-05-19 00:20:43 +03:00
parent fa6a6682d3
commit 3dfb212562
5 changed files with 29 additions and 7 deletions

View File

@ -75,8 +75,10 @@ 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 supportsFinal() const override { return true; }
bool supportsPrewhere() const override { return true; }
bool supportsFinal() const override { return true; }
bool supportsIndexForIn() const override { return true; }
bool supportsParallelReplicas() const override { return true; }
/// Структура подчинённой таблицы не проверяется и не изменяется.
void alter(const AlterCommands & params, const String & database_name, const String & table_name, Context & context) override;

View File

@ -26,9 +26,11 @@ public:
NameAndTypePair getColumn(const String & column_name) const override;
bool hasColumn(const String & column_name) const override;
bool supportsSampling() const override { return data->supportsSampling(); }
bool supportsFinal() const override { return data->supportsFinal(); }
bool supportsPrewhere() const override { return data->supportsPrewhere(); }
bool supportsSampling() const override { return data->supportsSampling(); }
bool supportsPrewhere() const override { return data->supportsPrewhere(); }
bool supportsFinal() const override { return data->supportsFinal(); }
bool supportsIndexForIn() const override { return data->supportsIndexForIn(); }
bool supportsParallelReplicas() const override { return data->supportsParallelReplicas(); }
BlockOutputStreamPtr write(ASTPtr query) override;
void drop() override;

View File

@ -37,12 +37,12 @@ public:
std::string getName() const override { return "Merge"; }
std::string getTableName() const override { return name; }
bool supportsSampling() const override { return true; }
/// Проверка откладывается до метода read. Там проверяется поддержка PREWHERE у использующихся таблиц.
bool supportsSampling() const override { return true; }
bool supportsPrewhere() const override { return true; }
bool supportsParallelReplicas() const override { return true; }
bool supportsFinal() const override { return true; }
bool supportsIndexForIn() const override { return true; }
const NamesAndTypesList & getColumnsListImpl() const override { return *columns; }
NameAndTypePair getColumn(const String &column_name) const override;

View File

@ -0,0 +1,4 @@
2015-05-01 12345 1
2015-05-01 67890 1
2015-05-01 12345 1
2015-05-01 67890 1

View File

@ -0,0 +1,14 @@
DROP TABLE IF EXISTS test.mt;
DROP TABLE IF EXISTS test.merge;
CREATE TABLE test.mt (d Date DEFAULT toDate('2015-05-01'), x UInt64) ENGINE = MergeTree(d, x, 1);
CREATE TABLE test.merge (d Date, x UInt64) ENGINE = Merge(test, '^mt$');
SET max_block_size = 1000000;
INSERT INTO test.mt SELECT number AS x FROM system.numbers LIMIT 100000;
SELECT *, b FROM test.mt WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
SELECT *, b FROM test.merge WHERE x IN (12345, 67890) AND NOT ignore(blockSize() < 10 AS b) ORDER BY x;
DROP TABLE test.merge;
DROP TABLE test.mt;