From 899d88459a94164bb18f2178e1424c3a9ec49d27 Mon Sep 17 00:00:00 2001 From: hexiaoting Date: Thu, 22 Apr 2021 15:13:46 +0800 Subject: [PATCH] Add testcases for arrayElement --- .../01845_add_testcase_for_arrayElement.reference | 0 .../01845_add_testcase_for_arrayElement.sql | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/queries/0_stateless/01845_add_testcase_for_arrayElement.reference create mode 100644 tests/queries/0_stateless/01845_add_testcase_for_arrayElement.sql diff --git a/tests/queries/0_stateless/01845_add_testcase_for_arrayElement.reference b/tests/queries/0_stateless/01845_add_testcase_for_arrayElement.reference new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/queries/0_stateless/01845_add_testcase_for_arrayElement.sql b/tests/queries/0_stateless/01845_add_testcase_for_arrayElement.sql new file mode 100644 index 00000000000..6aeb71b8511 --- /dev/null +++ b/tests/queries/0_stateless/01845_add_testcase_for_arrayElement.sql @@ -0,0 +1,13 @@ +DROP TABLE IF EXISTS test; +CREATE TABLE test (`key` UInt32, `arr` ALIAS [1, 2], `xx` MATERIALIZED arr[1]) ENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple(); +DROP TABLE test; + +CREATE TABLE test (`key` UInt32, `arr` Array(UInt32) ALIAS [1, 2], `xx` MATERIALIZED arr[1]) ENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple(); +DROP TABLE test; + +CREATE TABLE test (`key` UInt32, `arr` Array(UInt32) ALIAS [1, 2], `xx` UInt32 MATERIALIZED arr[1]) ENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple(); +DROP TABLE test; + +CREATE TABLE test (`key` UInt32, `arr` ALIAS [1, 2]) ENGINE = MergeTree PARTITION BY tuple() ORDER BY tuple(); +ALTER TABLE test ADD COLUMN `xx` UInt32 MATERIALIZED arr[1]; +DROP TABLE test;