From f3e3df4593b66dc13d45533dd229ebcb229daca4 Mon Sep 17 00:00:00 2001 From: alesapin Date: Fri, 3 Apr 2020 14:15:43 +0300 Subject: [PATCH] Better test --- .../0_stateless/01213_alter_rename_nested.reference | 8 ++++++-- .../queries/0_stateless/01213_alter_rename_nested.sql | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/queries/0_stateless/01213_alter_rename_nested.reference b/tests/queries/0_stateless/01213_alter_rename_nested.reference index 51647dc2e7b..90c1a0316d0 100644 --- a/tests/queries/0_stateless/01213_alter_rename_nested.reference +++ b/tests/queries/0_stateless/01213_alter_rename_nested.reference @@ -1,6 +1,10 @@ [8,9,10] ['a','b','c'] -CREATE TABLE default.table_for_rename_nested (`date` Date, `key` UInt64, `n.x` Array(UInt32), `n.y` Array(String), `value1` String) ENGINE = MergeTree() PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192 -CREATE TABLE default.table_for_rename_nested (`date` Date, `key` UInt64, `n.renamed_x` Array(UInt32), `n.renamed_y` Array(String), `value1` String) ENGINE = MergeTree() PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192 +CREATE TABLE default.table_for_rename_nested (`date` Date, `key` UInt64, `n.x` Array(UInt32), `n.y` Array(String), `value1` LowCardinality(String)) ENGINE = MergeTree() PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192 +CREATE TABLE default.table_for_rename_nested (`date` Date, `key` UInt64, `n.renamed_x` Array(UInt32), `n.renamed_y` Array(String), `value1` LowCardinality(String)) ENGINE = MergeTree() PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192 7 [8,9,10] 7 ['a','b','c'] +7 +CREATE TABLE default.table_for_rename_nested (`date` Date, `key` UInt64, `n.renamed_x` Array(UInt32), `n.renamed_y` Array(String), `renamed_value1` LowCardinality(String)) ENGINE = MergeTree() PARTITION BY date ORDER BY key SETTINGS index_granularity = 8192 +date key n.renamed_x n.renamed_y renamed_value1 +2019-10-01 7 [8,9,10] ['a','b','c'] 7 diff --git a/tests/queries/0_stateless/01213_alter_rename_nested.sql b/tests/queries/0_stateless/01213_alter_rename_nested.sql index 8dc221ef388..762a0bb802e 100644 --- a/tests/queries/0_stateless/01213_alter_rename_nested.sql +++ b/tests/queries/0_stateless/01213_alter_rename_nested.sql @@ -4,7 +4,7 @@ CREATE TABLE table_for_rename_nested date Date, key UInt64, n Nested(x UInt32, y String), - value1 String + value1 LowCardinality(String) -- column with several files ) ENGINE = MergeTree() PARTITION BY date @@ -30,5 +30,13 @@ ALTER TABLE table_for_rename_nested RENAME COLUMN n.renamed_x TO not_nested_x; - -- Currently not implemented ALTER TABLE table_for_rename_nested RENAME COLUMN n TO renamed_n; --{serverError 48} +ALTER TABLE table_for_rename_nested RENAME COLUMN value1 TO renamed_value1; + +SELECT renamed_value1 FROM table_for_rename_nested WHERE key = 7; + +SHOW CREATE TABLE table_for_rename_nested; + +SELECT * FROM table_for_rename_nested WHERE key = 7 FORMAT TSVWithNames; + DROP TABLE IF EXISTS table_for_rename_nested;