This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git

commit e3b4b83bca728ca11e19765f9e641b519f3ed92b
Author: Ashin Gau <[email protected]>
AuthorDate: Thu Feb 22 13:42:30 2024 +0800

    [test](regression) add regression test for schange change of complex type 
(#31207)
    
    Add regression test for #31128
---
 .../hive/scripts/create_preinstalled_table.hql             | 14 ++++++++++++++
 .../suites/external_table_p0/hive/test_hive_parquet.groovy | 10 ++++++++++
 2 files changed, 24 insertions(+)

diff --git 
a/docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_table.hql 
b/docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_table.hql
index 9baf13020f6..00d2a699410 100644
--- 
a/docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_table.hql
+++ 
b/docker/thirdparties/docker-compose/hive/scripts/create_preinstalled_table.hql
@@ -1937,3 +1937,17 @@ with serdeproperties
 ,'seperatorChar'=',');
 
 insert into employee_gz values ('a', '1.1'), ('b', '2.2');
+
+create database hive_schema_change;
+use hive_schema_change;
+
+create table struct_test (
+  id int,
+  sf struct<f1: int, f2: map<string, string>>) stored as parquet;
+
+insert into struct_test values
+(1, named_struct('f1', 1, 'f2', str_to_map('1:s2,2:s2'))),
+(2, named_struct('f1', 2, 'f2', str_to_map('k1:s3,k2:s4'))),
+(3, named_struct('f1', 3, 'f2', str_to_map('k1:s5,k2:s6')));
+
+alter table struct_test change sf sf struct<f1:int, f2: string>;
diff --git 
a/regression-test/suites/external_table_p0/hive/test_hive_parquet.groovy 
b/regression-test/suites/external_table_p0/hive/test_hive_parquet.groovy
index c381a3c236b..dff86e77285 100644
--- a/regression-test/suites/external_table_p0/hive/test_hive_parquet.groovy
+++ b/regression-test/suites/external_table_p0/hive/test_hive_parquet.groovy
@@ -169,6 +169,15 @@ suite("test_hive_parquet", 
"p0,external,hive,external_docker,external_docker_hiv
         """
     }
 
+    def q23 = {
+        sql """use hive_schema_change"""
+        // not support the schema change of complex type
+        test {
+            sql "select * from struct_test"
+            exception "Wrong data type for column 'f2'"
+        }
+    }
+
     String enabled = context.config.otherConfigs.get("enableHiveTest")
     if (enabled != null && enabled.equalsIgnoreCase("true")) {
         try {
@@ -207,6 +216,7 @@ suite("test_hive_parquet", 
"p0,external,hive,external_docker,external_docker_hiv
             q20()
             q21()
             q22()
+            q23()
 
             sql """explain physical plan select l_partkey from partition_table
                 where (nation != 'cn' or city !='beijing') and (l_quantity > 
28 or l_extendedprice > 30000)


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to