mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Trying to fix issue with calculating default expressions. (Not working yet)
This commit is contained in:
parent
507609b611
commit
78ab3127ce
@ -1,4 +1,5 @@
|
||||
#include <DataStreams/AddingDefaultBlockOutputStream.h>
|
||||
#include <DataStreams/AddingMissedBlockInputStream.h>
|
||||
#include <DataStreams/ConvertingBlockInputStream.h>
|
||||
#include <DataStreams/PushingToViewsBlockOutputStream.h>
|
||||
#include <DataStreams/SquashingBlockInputStream.h>
|
||||
@ -230,7 +231,9 @@ void PushingToViewsBlockOutputStream::process(const Block & block, size_t view_n
|
||||
/// and two-level aggregation is triggered).
|
||||
in = std::make_shared<SquashingBlockInputStream>(
|
||||
in, context.getSettingsRef().min_insert_block_size_rows, context.getSettingsRef().min_insert_block_size_bytes);
|
||||
in = std::make_shared<ConvertingBlockInputStream>(context, in, view.out->getHeader(), ConvertingBlockInputStream::MatchColumnsMode::NameOrDefault);
|
||||
in = std::make_shared<AddingMissedBlockInputStream>(
|
||||
in, view.out->getHeader(), storage->getColumns().getDefaults(), local_context);
|
||||
in = std::make_shared<ConvertingBlockInputStream>(context, in, view.out->getHeader(), ConvertingBlockInputStream::MatchColumnsMode::Name);
|
||||
}
|
||||
else
|
||||
in = std::make_shared<OneBlockInputStream>(block);
|
||||
|
@ -1,3 +1,4 @@
|
||||
DROP TABLE IF EXISTS mv;
|
||||
DROP TABLE IF EXISTS mv_source;
|
||||
DROP TABLE IF EXISTS mv_target;
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
1 0
|
||||
1 2
|
||||
2 3
|
||||
3 4
|
@ -0,0 +1,16 @@
|
||||
DROP TABLE IF EXISTS mv;
|
||||
DROP TABLE IF EXISTS mv_source;
|
||||
DROP TABLE IF EXISTS mv_target;
|
||||
|
||||
CREATE TABLE mv_source (`a` UInt64) ENGINE = MergeTree ORDER BY tuple();
|
||||
CREATE TABLE mv_target (`a` UInt64) ENGINE = MergeTree ORDER BY tuple();
|
||||
|
||||
CREATE MATERIALIZED VIEW mv TO mv_target AS SELECT * FROM mv_source;
|
||||
|
||||
INSERT INTO mv_source VALUES (1);
|
||||
|
||||
ALTER TABLE mv_target ADD COLUMN b UInt8 DEFAULT a + 1;
|
||||
INSERT INTO mv_source VALUES (1),(2),(3);
|
||||
|
||||
SELECT * FROM mv ORDER BY a;
|
||||
SELECT * FROM mv_target ORDER BY a;
|
Loading…
Reference in New Issue
Block a user