mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Do not convert columns by position when pushing to materialized views (#6415)
* Do not convert columns by position * Update 00984_materialized_view_to_columns.reference
This commit is contained in:
parent
838c5e535f
commit
cce3ab08bb
@ -193,7 +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 = std::make_shared<ConvertingBlockInputStream>(context, in, view.out->getHeader(), ConvertingBlockInputStream::MatchColumnsMode::Name);
|
||||
|
||||
in->readPrefix();
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
1 test
|
@ -0,0 +1,15 @@
|
||||
DROP TABLE IF EXISTS test1;
|
||||
DROP TABLE IF EXISTS test2;
|
||||
DROP TABLE IF EXISTS mv;
|
||||
|
||||
CREATE TABLE test1 (a UInt8, b String) ENGINE MergeTree ORDER BY a;
|
||||
CREATE TABLE test2 (c UInt8, d String) ENGINE MergeTree ORDER BY c;
|
||||
CREATE MATERIALIZED VIEW mv TO test1 (b String, a UInt8) AS SELECT d AS b, c AS a FROM test2;
|
||||
|
||||
INSERT INTO test2 VALUES (1, 'test');
|
||||
|
||||
SELECT * FROM test1;
|
||||
|
||||
DROP TABLE test1;
|
||||
DROP TABLE test2;
|
||||
DROP TABLE mv;
|
Loading…
Reference in New Issue
Block a user