forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix INSERT into Distributed() table with MATERIALIZED column
By just skipping MATERIALIZED columns during processing. P.S. you cannot use insert_allow_materialized_columns since it works only for Buffer() engine. Fixes: ClickHouse#4015 Fixes: ClickHouse#3673 Fixes: 01501fa ("correct column list for rewritten INSERT query into Distributed [#CLICKHOUSE-4161]")
- Loading branch information
Showing
3 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...ests/queries/0_stateless/00952_insert_into_distributed_with_materialized_column.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
2018-08-01 | ||
2018-08-01 | ||
2018-08-01 2017-08-01 |
12 changes: 12 additions & 0 deletions
12
dbms/tests/queries/0_stateless/00952_insert_into_distributed_with_materialized_column.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
DROP TABLE IF EXISTS test.test_local; | ||
DROP TABLE IF EXISTS test.test_distributed; | ||
|
||
CREATE TABLE test.test_local (date Date, value Date MATERIALIZED toDate('2017-08-01')) ENGINE = MergeTree(date, date, 8192); | ||
CREATE TABLE test.test_distributed AS test.test_local ENGINE = Distributed('test_shard_localhost', 'test', test_local, rand()); | ||
|
||
SET insert_distributed_sync=1; | ||
|
||
INSERT INTO test.test_distributed VALUES ('2018-08-01'); | ||
SELECT * FROM test.test_distributed; | ||
SELECT * FROM test.test_local; | ||
SELECT date, value FROM test.test_local; |