mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
23 lines
640 B
SQL
23 lines
640 B
SQL
DROP TABLE IF EXISTS t_update_empty_nested;
|
|
|
|
CREATE TABLE t_update_empty_nested
|
|
(
|
|
`id` UInt32,
|
|
`nested.arr1` Array(UInt64),
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY id
|
|
SETTINGS min_bytes_for_wide_part = 0;
|
|
|
|
SET mutations_sync = 2;
|
|
|
|
INSERT INTO t_update_empty_nested SELECT 1, range(number % 10) FROM numbers(100000);
|
|
ALTER TABLE t_update_empty_nested ADD COLUMN `nested.arr2` Array(UInt64);
|
|
|
|
ALTER TABLE t_update_empty_nested UPDATE `nested.arr2` = `nested.arr1` WHERE 1;
|
|
|
|
SELECT * FROM t_update_empty_nested FORMAT Null;
|
|
SELECT sum(length(nested.arr1)), sum(length(nested.arr2)) FROM t_update_empty_nested;
|
|
|
|
DROP TABLE t_update_empty_nested;
|