mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Fix recursive materialized view
This commit is contained in:
parent
7388454eb2
commit
39b8141418
@ -1,4 +1,5 @@
|
||||
#include <DataStreams/AddingDefaultBlockOutputStream.h>
|
||||
#include <DataStreams/ConvertingBlockInputStream.h>
|
||||
#include <DataStreams/PushingToViewsBlockOutputStream.h>
|
||||
#include <DataStreams/SquashingBlockInputStream.h>
|
||||
#include <DataTypes/NestedUtils.h>
|
||||
@ -192,6 +193,7 @@ 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::Position);
|
||||
|
||||
in->readPrefix();
|
||||
|
||||
|
@ -0,0 +1,4 @@
|
||||
2
|
||||
3
|
||||
3
|
||||
4
|
@ -0,0 +1,18 @@
|
||||
DROP TABLE IF EXISTS test.src;
|
||||
DROP TABLE IF EXISTS test.dst1;
|
||||
DROP TABLE IF EXISTS test.dst2;
|
||||
|
||||
USE test;
|
||||
|
||||
CREATE TABLE src (x UInt8) ENGINE Memory;
|
||||
CREATE TABLE dst1 (x UInt8) ENGINE Memory;
|
||||
CREATE MATERIALIZED VIEW src_to_dst1 TO dst1 AS SELECT x + 1 as x FROM src;
|
||||
CREATE MATERIALIZED VIEW dst2 ENGINE Memory AS SELECT x + 1 as x FROM dst1;
|
||||
|
||||
INSERT INTO src VALUES (1), (2);
|
||||
SELECT * FROM dst1 ORDER BY x;
|
||||
SELECT * FROM dst2 ORDER BY x;
|
||||
|
||||
DROP TABLE src;
|
||||
DROP TABLE dst1;
|
||||
DROP TABLE dst2;
|
Loading…
Reference in New Issue
Block a user