From e2473053d644f4085070e51cd5d72f4a8db5cedf Mon Sep 17 00:00:00 2001 From: amorynan Date: Mon, 12 Aug 2024 11:35:12 +0800 Subject: [PATCH 1/5] improve schema change for nested type --- .../org/apache/doris/catalog/ColumnType.java | 6 +-- .../create_nestedtypes_with_schemachange.out | 16 +++++++ ...reate_nestedtypes_with_schemachange.groovy | 46 +++++++++++++++++++ 3 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out create mode 100644 regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/ColumnType.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/ColumnType.java index 974ad691c99827..458a6a46110f40 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/ColumnType.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/ColumnType.java @@ -159,9 +159,9 @@ public abstract class ColumnType { schemaChangeMatrix[PrimitiveType.DATETIMEV2.ordinal()][PrimitiveType.DATETIMEV2.ordinal()] = true; // Currently, we do not support schema change between complex types with subtypes. - schemaChangeMatrix[PrimitiveType.ARRAY.ordinal()][PrimitiveType.ARRAY.ordinal()] = false; - schemaChangeMatrix[PrimitiveType.STRUCT.ordinal()][PrimitiveType.STRUCT.ordinal()] = false; - schemaChangeMatrix[PrimitiveType.MAP.ordinal()][PrimitiveType.MAP.ordinal()] = false; + schemaChangeMatrix[PrimitiveType.ARRAY.ordinal()][PrimitiveType.ARRAY.ordinal()] = true; + schemaChangeMatrix[PrimitiveType.STRUCT.ordinal()][PrimitiveType.STRUCT.ordinal()] = true; + schemaChangeMatrix[PrimitiveType.MAP.ordinal()][PrimitiveType.MAP.ordinal()] = true; } static boolean isSchemaChangeAllowed(Type lhs, Type rhs) { diff --git a/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out b/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out new file mode 100644 index 00000000000000..cbed2d25326491 --- /dev/null +++ b/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out @@ -0,0 +1,16 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col_array array Yes false \N NONE + +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col_map map Yes false \N NONE + +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col_struct struct Yes false \N NONE + diff --git a/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy b/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy new file mode 100644 index 00000000000000..351c7187ff1231 --- /dev/null +++ b/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy @@ -0,0 +1,46 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("create_nestedtypes_with_schemachange", "p0") { + + def create_nested_table_and_schema_change = {testTablex, nested_type, column_name -> + // create basic type + sql "DROP TABLE IF EXISTS $testTablex" + sql """ CREATE TABLE $testTablex ( + col0 BIGINT NOT NULL, col2 int NOT NULL + ) + /* mow */ + UNIQUE KEY(col0) DISTRIBUTED BY HASH(col0) BUCKETS 4 PROPERTIES ( + "enable_unique_key_merge_on_write" = "true", + "replication_num" = "1" + ); """ + // alter table add nested type + sql "ALTER TABLE $testTablex ADD COLUMN $column_name $nested_type" + // alter table modify column order + sql "ALTER TABLE $testTablex MODIFY COLUMN $column_name $nested_type AFTER col0" + // desc table + qt_sql "DESC $testTablex" + } + + // array + create_nested_table_and_schema_change.call("test_array_schemachange", "ARRAY", "col_array") + // map + create_nested_table_and_schema_change.call("test_map_schemachange", "MAP", "col_map") + // struct + create_nested_table_and_schema_change.call("test_struct_schemachange", "STRUCT", "col_struct") + +} From 099b71713dbf5f1630f7726b9443ec3db96e167b Mon Sep 17 00:00:00 2001 From: amorynan Date: Mon, 12 Aug 2024 15:46:18 +0800 Subject: [PATCH 2/5] fixed --- .../java/org/apache/doris/catalog/Column.java | 5 +++ .../create_nestedtypes_with_schemachange.out | 36 +++++++++++++++++-- ...reate_nestedtypes_with_schemachange.groovy | 35 +++++++++++++----- 3 files changed, 65 insertions(+), 11 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java index 0aca7e4e28e31a..91da43627dfe4d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Column.java @@ -813,6 +813,11 @@ public void checkSchemaChangeAllowed(Column other) throws DdlException { throw new DdlException("Dest column name is empty"); } + // now nested type can only support change order + if (type.isComplexType() && !type.equals(other.type)) { + throw new DdlException("Can not change " + type + " to " + other); + } + if (!ColumnType.isSchemaChangeAllowed(type, other.type)) { throw new DdlException("Can not change " + getDataType() + " to " + other.getDataType()); } diff --git a/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out b/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out index cbed2d25326491..af88eb6b9bb042 100644 --- a/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out +++ b/regression-test/data/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.out @@ -1,16 +1,46 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql -- col0 bigint No true \N -col2 int No false \N NONE col_array array Yes false \N NONE +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE -- !sql -- col0 bigint No true \N -col2 int No false \N NONE col_map map Yes false \N NONE +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE -- !sql -- col0 bigint No true \N -col2 int No false \N NONE col_struct struct Yes false \N NONE +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE + +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE + +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE + +-- !sql -- +col0 bigint No true \N +col2 int No false \N NONE +col3 array Yes false \N NONE +col4 map Yes false \N NONE +col5 struct Yes false \N NONE diff --git a/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy b/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy index 351c7187ff1231..ec0f163821d16a 100644 --- a/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy +++ b/regression-test/suites/datatype_p0/nested_types/ddl/create_nestedtypes_with_schemachange.groovy @@ -17,11 +17,11 @@ suite("create_nestedtypes_with_schemachange", "p0") { - def create_nested_table_and_schema_change = {testTablex, nested_type, column_name -> + def create_nested_table_and_schema_change = {testTablex, nested_type, column_name, error -> // create basic type sql "DROP TABLE IF EXISTS $testTablex" sql """ CREATE TABLE $testTablex ( - col0 BIGINT NOT NULL, col2 int NOT NULL + col0 BIGINT NOT NULL, col2 int NOT NULL, col3 array NULL, col4 map NULL, col5 struct NULL ) /* mow */ UNIQUE KEY(col0) DISTRIBUTED BY HASH(col0) BUCKETS 4 PROPERTIES ( @@ -29,18 +29,37 @@ suite("create_nestedtypes_with_schemachange", "p0") { "replication_num" = "1" ); """ // alter table add nested type - sql "ALTER TABLE $testTablex ADD COLUMN $column_name $nested_type" - // alter table modify column order - sql "ALTER TABLE $testTablex MODIFY COLUMN $column_name $nested_type AFTER col0" + if (error != '') { + // check nested type do not support other type + test { + sql "ALTER TABLE $testTablex MODIFY COLUMN $column_name $nested_type AFTER col0" + exception (error) + } + } else { + // check nested type can only support change order + sql "ALTER TABLE $testTablex ADD COLUMN $column_name $nested_type" + sql "ALTER TABLE $testTablex MODIFY COLUMN $column_name $nested_type AFTER col0" + waitForSchemaChangeDone { + sql """ SHOW ALTER TABLE COLUMN WHERE IndexName='$testTablex' ORDER BY createtime DESC LIMIT 1 """ + time 600 + } + } // desc table qt_sql "DESC $testTablex" } // array - create_nested_table_and_schema_change.call("test_array_schemachange", "ARRAY", "col_array") + create_nested_table_and_schema_change.call("test_array_schemachange", "ARRAY", "col_array", '') // map - create_nested_table_and_schema_change.call("test_map_schemachange", "MAP", "col_map") + create_nested_table_and_schema_change.call("test_map_schemachange", "MAP", "col_map", '') // struct - create_nested_table_and_schema_change.call("test_struct_schemachange", "STRUCT", "col_struct") + create_nested_table_and_schema_change.call("test_struct_schemachange", "STRUCT", "col_struct", '') + + // array with other type + create_nested_table_and_schema_change.call("test_array_schemachange_1", "ARRAY", "col3", "errCode = 2"); + // map with other type + create_nested_table_and_schema_change.call("test_map_schemachange_1", "MAP", "col4", "errCode = 2"); + // struct with other type + create_nested_table_and_schema_change.call("test_struct_schemachange_1", "STRUCT", "col5", "errCode = 2"); } From 794a9962e0114234ec41ee041ed6e7167d368fbd Mon Sep 17 00:00:00 2001 From: amorynan Date: Mon, 12 Aug 2024 17:20:54 +0800 Subject: [PATCH 3/5] fixed --- .../test_dup_schema_value_modify3.groovy | 60 +++++++++---------- .../test_dup_schema_value_modify4.groovy | 60 +++++++++---------- .../test_unique_schema_value_modify3.groovy | 60 +++++++++---------- 3 files changed, 90 insertions(+), 90 deletions(-) diff --git a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy index f6dafb80aee6c0..245189776a2da7 100644 --- a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy @@ -88,8 +88,8 @@ suite("test_dup_schema_value_modify3", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]');" //TODO Test the dup model by modify a value type from MAP to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m BOOLEAN """ @@ -102,8 +102,8 @@ suite("test_dup_schema_value_modify3", "p0") { // TODO Test the dup model by modify a value type from MAP to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m TINYINT """ @@ -116,8 +116,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from MAP to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m SMALLINT """ @@ -130,8 +130,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to INT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m INT """ @@ -145,8 +145,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from MAP to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m BIGINT """ @@ -159,8 +159,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m LARGEINT """ @@ -173,8 +173,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from MAP to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m FLOAT """ @@ -187,8 +187,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from MAP to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DECIMAL(38,0) """ @@ -202,8 +202,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from MAP to DATE - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATE """ @@ -216,8 +216,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from MAP to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATEV2 """ @@ -231,8 +231,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATETIME """ @@ -245,8 +245,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATETIMEV2 """ @@ -260,8 +260,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from MAP to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change MAP to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m VARCHAR(100) """ @@ -273,8 +273,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to STRING - errorMessage = "errCode = 2, detailMessage = Can not change MAP to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m STRING """ @@ -286,8 +286,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to JSON - errorMessage = "errCode = 2, detailMessage = Can not change MAP to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m JSON """ diff --git a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy index 23ffe95f2de771..da3e9a50383d31 100644 --- a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy @@ -87,8 +87,8 @@ suite("test_dup_schema_value_modify4", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]');" //TODO Test the dup model by modify a value type from MAP to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m BOOLEAN """ @@ -101,8 +101,8 @@ suite("test_dup_schema_value_modify4", "p0") { // TODO Test the dup model by modify a value type from MAP to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m TINYINT """ @@ -115,8 +115,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from MAP to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m SMALLINT """ @@ -129,8 +129,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to INT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m INT """ @@ -144,8 +144,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from MAP to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m BIGINT """ @@ -158,8 +158,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m LARGEINT """ @@ -172,8 +172,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from MAP to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m FLOAT """ @@ -186,8 +186,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from MAP to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DECIMAL(38,0) """ @@ -201,8 +201,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from MAP to DATE - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATE """ @@ -215,8 +215,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from MAP to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATEV2 """ @@ -230,8 +230,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATETIME """ @@ -244,8 +244,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m DATETIMEV2 """ @@ -259,8 +259,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from MAP to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change MAP to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m VARCHAR(100) """ @@ -272,8 +272,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to STRING - errorMessage = "errCode = 2, detailMessage = Can not change MAP to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m STRING """ @@ -285,8 +285,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from MAP to JSON - errorMessage = "errCode = 2, detailMessage = Can not change MAP to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column m JSON """ diff --git a/regression-test/suites/schema_change_p0/test_unique_schema_value_modify3.groovy b/regression-test/suites/schema_change_p0/test_unique_schema_value_modify3.groovy index 07ed02f154a464..0c9bcbf29e8933 100644 --- a/regression-test/suites/schema_change_p0/test_unique_schema_value_modify3.groovy +++ b/regression-test/suites/schema_change_p0/test_unique_schema_value_modify3.groovy @@ -90,8 +90,8 @@ suite("test_unique_schema_value_modify3", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]');" //TODO Test the unique model by modify a value type from MAP to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m BOOLEAN """ @@ -104,8 +104,8 @@ suite("test_unique_schema_value_modify3", "p0") { // TODO Test the unique model by modify a value type from MAP to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m TINYINT """ @@ -118,8 +118,8 @@ suite("test_unique_schema_value_modify3", "p0") { //Test the unique model by modify a value type from MAP to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m SMALLINT """ @@ -132,8 +132,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //Test the unique model by modify a value type from MAP to INT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m INT """ @@ -147,8 +147,8 @@ suite("test_unique_schema_value_modify3", "p0") { //Test the unique model by modify a value type from MAP to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m BIGINT """ @@ -161,8 +161,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //Test the unique model by modify a value type from MAP to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m LARGEINT """ @@ -175,8 +175,8 @@ suite("test_unique_schema_value_modify3", "p0") { //Test the unique model by modify a value type from MAP to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change MAP to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m FLOAT """ @@ -189,8 +189,8 @@ suite("test_unique_schema_value_modify3", "p0") { //TODO Test the unique model by modify a value type from MAP to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m DECIMAL(38,0) """ @@ -204,8 +204,8 @@ suite("test_unique_schema_value_modify3", "p0") { //TODO Test the unique model by modify a value type from MAP to DATE - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m DATE """ @@ -218,8 +218,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the unique model by modify a value type from MAP to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m DATEV2 """ @@ -233,8 +233,8 @@ suite("test_unique_schema_value_modify3", "p0") { //TODO Test the unique model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m DATETIME """ @@ -247,8 +247,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the unique model by modify a value type from MAP to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change MAP to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m DATETIMEV2 """ @@ -262,8 +262,8 @@ suite("test_unique_schema_value_modify3", "p0") { //Test the unique model by modify a value type from MAP to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change MAP to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m VARCHAR(100) """ @@ -275,8 +275,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //Test the unique model by modify a value type from MAP to STRING - errorMessage = "errCode = 2, detailMessage = Can not change MAP to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m STRING """ @@ -288,8 +288,8 @@ suite("test_unique_schema_value_modify3", "p0") { }, errorMessage) //Test the unique model by modify a value type from MAP to JSON - errorMessage = "errCode = 2, detailMessage = Can not change MAP to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName} MODIFY column m JSON """ From d4d32ff3f7acd56299242e67578ee0a5873eea16 Mon Sep 17 00:00:00 2001 From: amorynan Date: Tue, 13 Aug 2024 20:43:41 +0800 Subject: [PATCH 4/5] fix --- .../test_dup_schema_value_modify4.groovy | 176 +++++++++--------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy index da3e9a50383d31..292c0649ec7af7 100644 --- a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy @@ -109,7 +109,7 @@ suite("test_dup_schema_value_modify4", "p0") { insertSql = "insert into ${tbName1} values(923456689, 'Alice', 2.2, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', 1, '{\"k1\":\"v1\", \"k2\": 200}'); " waitForSchemaChangeDone({ sql getTableStatusSql - time 120 + time 600 }, insertSql, true, "${tbName1}") }, errorMessage) @@ -332,7 +332,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to BOOLEAN errorMessage = "errCode = 2, detailMessage = Can not change JSON to BOOLEAN" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j BOOLEAN """ @@ -346,21 +346,21 @@ suite("test_dup_schema_value_modify4", "p0") { // TODO Test the dup model by modify a value type from JSON to TINYINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to TINYINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j TINYINT """ insertSql = "insert into ${tbName1} values(923456689, 'Alice', 2.2, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', {'a': 700, 'b': 200}, 1); " waitForSchemaChangeDone({ sql getTableStatusSql - time 120 + time 600 }, insertSql, true, "${tbName1}") }, errorMessage) //Test the dup model by modify a value type from JSON to SMALLINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to SMALLINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j SMALLINT """ @@ -374,7 +374,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to INT errorMessage = "errCode = 2, detailMessage = Can not change JSON to INT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j INT """ @@ -389,7 +389,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to BIGINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to BIGINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j BIGINT """ @@ -403,7 +403,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to LARGEINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to LARGEINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j LARGEINT """ @@ -417,7 +417,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to FLOAT errorMessage = "errCode = 2, detailMessage = Can not change JSON to FLOAT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j FLOAT """ @@ -431,7 +431,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to DECIMAL errorMessage = "errCode = 2, detailMessage = Can not change JSON to DECIMAL128" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DECIMAL(38,0) """ @@ -446,7 +446,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to DATE errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATE """ @@ -460,7 +460,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to DATEV2 errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATEV2 """ @@ -475,7 +475,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to DATETIME errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATETIMEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATETIME """ @@ -489,7 +489,7 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from JSON to DATETIME errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATETIMEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATETIMEV2 """ @@ -504,7 +504,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to VARCHAR errorMessage = "errCode = 2, detailMessage = Can not change JSON to VARCHAR" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j VARCHAR(100) """ @@ -517,7 +517,7 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from JSON to STRING errorMessage = "errCode = 2, detailMessage = Can not change JSON to STRING" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j STRING """ @@ -529,8 +529,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from JSON to MAP - errorMessage = "expected:<[FINISH]ED> but was:<[CANCELL]ED>" - expectException({ + errorMessage = "errCode = 2" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j JSON """ @@ -576,8 +576,8 @@ suite("test_dup_schema_value_modify4", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]', [6,7,8], {1, 'sn1', 'sa1'});" //TODO Test the dup model by modify a value type from array to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array BOOLEAN """ @@ -590,22 +590,22 @@ suite("test_dup_schema_value_modify4", "p0") { // TODO Test the dup model by modify a value type from ARRAY to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array TINYINT """ insertSql = "insert into ${tbName1} values(923456689, 'Alice', 2.2, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', {'a': 700, 'b': 200}, '[\\\"abc\\\", \\\"def\\\"]', 1, {1, 'sn1', 'sa1'}); " waitForSchemaChangeDone({ sql getTableStatusSql - time 120 + time 600 }, insertSql, true, "${tbName1}") }, errorMessage) //Test the dup model by modify a value type from ARRAY to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array SMALLINT """ @@ -618,8 +618,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to INT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array INT """ @@ -633,8 +633,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from ARRAY to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array BIGINT """ @@ -647,8 +647,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array LARGEINT """ @@ -661,8 +661,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from ARRAY to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array FLOAT """ @@ -675,8 +675,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DECIMAL(38,0) """ @@ -690,8 +690,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DATE - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATE """ @@ -704,8 +704,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from ARRAY to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATEV2 """ @@ -719,8 +719,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATETIME """ @@ -733,8 +733,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from ARRAY to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATETIMEV2 """ @@ -748,8 +748,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from ARRAY to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array VARCHAR(100) """ @@ -761,8 +761,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to STRING - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array STRING """ @@ -774,8 +774,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array JSON """ @@ -787,8 +787,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to MAP" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array Map """ @@ -801,8 +801,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to STRUCT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array STRUCT """ @@ -849,8 +849,8 @@ suite("test_dup_schema_value_modify4", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]', [6,7,8], {1, 'sn1', 'sa1'});" //TODO Test the dup model by modify a value type from STRUCT to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT BOOLEAN """ @@ -863,22 +863,22 @@ suite("test_dup_schema_value_modify4", "p0") { // TODO Test the dup model by modify a value type from STRUCT to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT TINYINT """ insertSql = "insert into ${tbName1} values(923456689, 'Alice', 2.2, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', {'a': 700, 'b': 200}, '[\\\"abc\\\", \\\"def\\\"]', [6,7,8], 1); " waitForSchemaChangeDone({ sql getTableStatusSql - time 120 + time 600 }, insertSql, true, "${tbName1}") }, errorMessage) //Test the dup model by modify a value type from STRUCT to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT SMALLINT """ @@ -891,8 +891,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to INT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT INT """ @@ -906,8 +906,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from STRUCT to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT BIGINT """ @@ -920,8 +920,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT LARGEINT """ @@ -934,8 +934,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from STRUCT to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT FLOAT """ @@ -948,8 +948,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DECIMAL(38,0) """ @@ -963,8 +963,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DATE - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATE """ @@ -977,8 +977,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from STRUCT to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATEV2 """ @@ -992,8 +992,8 @@ suite("test_dup_schema_value_modify4", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATETIME """ @@ -1006,8 +1006,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from STRUCT to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATETIMEV2 """ @@ -1021,8 +1021,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from STRUCT to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT VARCHAR(100) """ @@ -1034,8 +1034,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to STRING - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT STRING """ @@ -1047,8 +1047,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to JSON - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT JSON """ @@ -1060,8 +1060,8 @@ suite("test_dup_schema_value_modify4", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to MAP - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to MAP" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT Map """ @@ -1074,8 +1074,8 @@ suite("test_dup_schema_value_modify4", "p0") { //Test the dup model by modify a value type from STRUCT to ARRAY - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to ARRAY" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT ARRAY """ From 124ffd228f6987e6abc85fb72a70361847c79043 Mon Sep 17 00:00:00 2001 From: amorynan Date: Tue, 13 Aug 2024 22:43:47 +0800 Subject: [PATCH 5/5] fix cases --- .../test_dup_schema_value_modify3.groovy | 170 +++++++++--------- .../test_dup_schema_value_modify4.groovy | 2 +- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy index 245189776a2da7..caa7a3ffa79133 100644 --- a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify3.groovy @@ -333,7 +333,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to BOOLEAN errorMessage = "errCode = 2, detailMessage = Can not change JSON to BOOLEAN" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j BOOLEAN """ @@ -347,7 +347,7 @@ suite("test_dup_schema_value_modify3", "p0") { // TODO Test the dup model by modify a value type from JSON to TINYINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to TINYINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j TINYINT """ @@ -361,7 +361,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to SMALLINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to SMALLINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j SMALLINT """ @@ -375,7 +375,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to INT errorMessage = "errCode = 2, detailMessage = Can not change JSON to INT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j INT """ @@ -390,7 +390,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to BIGINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to BIGINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j BIGINT """ @@ -404,7 +404,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to LARGEINT errorMessage = "errCode = 2, detailMessage = Can not change JSON to LARGEINT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j LARGEINT """ @@ -418,7 +418,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to FLOAT errorMessage = "errCode = 2, detailMessage = Can not change JSON to FLOAT" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j FLOAT """ @@ -432,7 +432,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to DECIMAL errorMessage = "errCode = 2, detailMessage = Can not change JSON to DECIMAL128" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DECIMAL(38,0) """ @@ -447,7 +447,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to DATE errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATE """ @@ -461,7 +461,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to DATEV2 errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATEV2 """ @@ -476,7 +476,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to DATETIME errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATETIMEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATETIME """ @@ -490,7 +490,7 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from JSON to DATETIME errorMessage = "errCode = 2, detailMessage = Can not change JSON to DATETIMEV2" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j DATETIMEV2 """ @@ -505,7 +505,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to VARCHAR errorMessage = "errCode = 2, detailMessage = Can not change JSON to VARCHAR" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j VARCHAR(100) """ @@ -518,7 +518,7 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from JSON to STRING errorMessage = "errCode = 2, detailMessage = Can not change JSON to STRING" - expectException({ + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column j STRING """ @@ -530,11 +530,11 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from JSON to MAP - errorMessage = "expected:<[FINISH]ED> but was:<[CANCELL]ED>" - expectException({ + errorMessage = "errCode = 2" + expectExceptionLike({ sql initTable sql initTableData - sql """ alter table ${tbName1} MODIFY column j JSON """ + sql """ alter table ${tbName1} MODIFY column j Map """ insertSql = "insert into ${tbName1} values(923456689, 'Alice', 8.47, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', {'a': 700, 'b': 200}, {'a': 700, 'b': 200}); " waitForSchemaChangeDone({ sql getTableStatusSql @@ -577,8 +577,8 @@ suite("test_dup_schema_value_modify3", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]', [6,7,8], {1, 'sn1', 'sa1'});" //TODO Test the dup model by modify a value type from array to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array BOOLEAN """ @@ -591,8 +591,8 @@ suite("test_dup_schema_value_modify3", "p0") { // TODO Test the dup model by modify a value type from ARRAY to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array TINYINT """ @@ -605,8 +605,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from ARRAY to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array SMALLINT """ @@ -619,8 +619,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to INT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array INT """ @@ -634,8 +634,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from ARRAY to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array BIGINT """ @@ -648,8 +648,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array LARGEINT """ @@ -662,8 +662,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from ARRAY to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array FLOAT """ @@ -676,8 +676,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DECIMAL(38,0) """ @@ -691,8 +691,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DATE - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATE """ @@ -705,8 +705,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from ARRAY to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATEV2 """ @@ -720,8 +720,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from ARRAY to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATETIME """ @@ -734,8 +734,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from ARRAY to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array DATETIMEV2 """ @@ -749,8 +749,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from ARRAY to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array VARCHAR(100) """ @@ -762,8 +762,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to STRING - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array STRING """ @@ -775,8 +775,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array JSON """ @@ -788,8 +788,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to MAP" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array Map """ @@ -802,8 +802,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from ARRAY to JSON - errorMessage = "errCode = 2, detailMessage = Can not change ARRAY to STRUCT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column array STRUCT """ @@ -850,8 +850,8 @@ suite("test_dup_schema_value_modify3", "p0") { " (789012345, 'Grace', 2.19656, 'Xian', 29, 0, 13333333333, 'No. 222 Street, Xian', '2022-07-07 22:00:00', {'a': 700, 'b': 200}, '[\"abc\", \"def\"]', [6,7,8], {1, 'sn1', 'sa1'});" //TODO Test the dup model by modify a value type from STRUCT to BOOLEAN - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to BOOLEAN" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT BOOLEAN """ @@ -864,8 +864,8 @@ suite("test_dup_schema_value_modify3", "p0") { // TODO Test the dup model by modify a value type from STRUCT to TINYINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to TINYINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT TINYINT """ @@ -878,8 +878,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from STRUCT to SMALLINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to SMALLINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT SMALLINT """ @@ -892,8 +892,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to INT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to INT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT INT """ @@ -907,8 +907,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from STRUCT to BIGINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to BIGINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT BIGINT """ @@ -921,8 +921,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to LARGEINT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to LARGEINT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT LARGEINT """ @@ -935,8 +935,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from STRUCT to FLOAT - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to FLOAT" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT FLOAT """ @@ -949,8 +949,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DECIMAL - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DECIMAL128" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DECIMAL(38,0) """ @@ -964,8 +964,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DATE - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATE """ @@ -978,8 +978,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from STRUCT to DATEV2 - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATEV2 """ @@ -993,8 +993,8 @@ suite("test_dup_schema_value_modify3", "p0") { //TODO Test the dup model by modify a value type from STRUCT to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATETIME """ @@ -1007,8 +1007,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //TODO Test the dup model by modify a value type from STRUCT to DATETIME - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to DATETIMEV2" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT DATETIMEV2 """ @@ -1022,8 +1022,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from STRUCT to VARCHAR - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to VARCHAR" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT VARCHAR(100) """ @@ -1035,8 +1035,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to STRING - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to STRING" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT STRING """ @@ -1048,8 +1048,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to JSON - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to JSON" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT JSON """ @@ -1061,8 +1061,8 @@ suite("test_dup_schema_value_modify3", "p0") { }, errorMessage) //Test the dup model by modify a value type from STRUCT to MAP - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to MAP" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT Map """ @@ -1075,8 +1075,8 @@ suite("test_dup_schema_value_modify3", "p0") { //Test the dup model by modify a value type from STRUCT to ARRAY - errorMessage = "errCode = 2, detailMessage = Can not change STRUCT to ARRAY" - expectException({ + errorMessage = "errCode = 2, detailMessage = Can not change" + expectExceptionLike({ sql initTable sql initTableData sql """ alter table ${tbName1} MODIFY column STRUCT ARRAY """ diff --git a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy index 292c0649ec7af7..525fc691688d04 100644 --- a/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy +++ b/regression-test/suites/schema_change_p0/test_dup_schema_value_modify4.groovy @@ -533,7 +533,7 @@ suite("test_dup_schema_value_modify4", "p0") { expectExceptionLike({ sql initTable sql initTableData - sql """ alter table ${tbName1} MODIFY column j JSON """ + sql """ alter table ${tbName1} MODIFY column j Map """ insertSql = "insert into ${tbName1} values(923456689, 'Alice', 8.47, 'yaan', 25, 0, 13812345678, 'No. 123 Street, Beijing', '2022-01-01 10:00:00', {'a': 700, 'b': 200}, {'a': 700, 'b': 200}); " waitForSchemaChangeDone({ sql getTableStatusSql