Skip to content

Commit

Permalink
add test_hudi_schema_evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
suxiaogang223 committed Nov 17, 2024
1 parent 6939e68 commit 362f5fe
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !adding_simple_columns_table --
20241118011808250 20241118011808250_0_1 1 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 1 Alice \N
20241118011808250 20241118011808250_0_0 2 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 2 Bob \N
20241118011808250 20241118011808250_0_2 3 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 3 Cathy \N
20241118011814200 20241118011814200_0_3 4 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 4 David 25
20241118011814200 20241118011814200_0_4 5 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 5 Eva 30
20241118011814200 20241118011814200_0_5 6 52471a9f-e8e0-46ae-b492-f090a881fbec-0_0-35-121_20241118011814200.parquet 6 Frank 28

-- !altering_simple_columns_table --
20241118011819566 20241118011819566_0_0 1 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 1 Alice 25.0
20241118011819566 20241118011819566_0_2 2 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 2 Bob 30.0
20241118011819566 20241118011819566_0_1 3 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 3 Cathy 28.0
20241118011821101 20241118011821101_0_3 4 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 4 David 26.0
20241118011821101 20241118011821101_0_4 5 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 5 Eva 31.5
20241118011821101 20241118011821101_0_5 6 d5178aff-9318-4f4d-8c1e-9d17fff92980-0_0-78-246_20241118011821101.parquet 6 Frank 29.2

-- !deleting_simple_columns_table --
20241118011823668 20241118011823668_0_1 1 9665ca27-ea45-49a3-b044-465db4471500-0_0-100-309_20241118011823668.parquet 1 Alice 25
20241118011823668 20241118011823668_0_0 2 9665ca27-ea45-49a3-b044-465db4471500-0_0-100-309_20241118011823668.parquet 2 Bob 30
20241118011823668 20241118011823668_0_2 3 9665ca27-ea45-49a3-b044-465db4471500-0_0-100-309_20241118011823668.parquet 3 Cathy 28

-- !renaming_simple_columns_table --
20241118011825614 20241118011825614_0_0 1 673d9ad3-dc3f-4f6a-80f8-dc72e2305dc8-0_0-122-372_20241118011825614.parquet 1 Alice
20241118011825614 20241118011825614_0_2 2 673d9ad3-dc3f-4f6a-80f8-dc72e2305dc8-0_0-122-372_20241118011825614.parquet 2 Bob
20241118011825614 20241118011825614_0_1 3 673d9ad3-dc3f-4f6a-80f8-dc72e2305dc8-0_0-122-372_20241118011825614.parquet 3 Cathy

-- !adding_complex_columns_table --
20241118011827479 20241118011827479_0_0 1 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 1 Alice {"age":25, "address":"Guangzhou", "email":null}
20241118011827479 20241118011827479_0_2 2 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 2 Bob {"age":30, "address":"Shanghai", "email":null}
20241118011827479 20241118011827479_0_1 3 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 3 Cathy {"age":28, "address":"Beijing", "email":null}
20241118011829143 20241118011829143_0_3 4 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 4 David {"age":25, "address":"Shenzhen", "email":"[email protected]"}
20241118011829143 20241118011829143_0_4 5 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 5 Eva {"age":30, "address":"Chengdu", "email":"[email protected]"}
20241118011829143 20241118011829143_0_5 6 1b8d6739-acf0-45c9-a1ee-e66577ccb4a6-0_0-165-497_20241118011829143.parquet 6 Frank {"age":28, "address":"Wuhan", "email":"[email protected]"}

-- !altering_complex_columns_table --
20241118011830794 20241118011830794_0_0 1 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 1 Alice {"age":25, "address":"Guangzhou"}
20241118011830794 20241118011830794_0_2 2 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 2 Bob {"age":30, "address":"Shanghai"}
20241118011830794 20241118011830794_0_1 3 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 3 Cathy {"age":28, "address":"Beijing"}
20241118011831837 20241118011831837_0_3 4 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 4 David {"age":26, "address":"Shenzhen"}
20241118011831837 20241118011831837_0_4 5 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 5 Eva {"age":31.5, "address":"Chengdu"}
20241118011831837 20241118011831837_0_5 6 8a5af5f5-7601-432a-a55b-ca77669efe08-0_0-208-622_20241118011831837.parquet 6 Frank {"age":29.2, "address":"Wuhan"}

-- !deleting_complex_columns_table --
20241118011834881 20241118011834881_0_1 1 9bdc363e-f445-4904-8001-7f5a76b32a97-0_0-230-685_20241118011834881.parquet 1 Alice {"age":25, "address":"Guangzhou"}
20241118011834881 20241118011834881_0_0 2 9bdc363e-f445-4904-8001-7f5a76b32a97-0_0-230-685_20241118011834881.parquet 2 Bob {"age":30, "address":"Shanghai"}
20241118011834881 20241118011834881_0_2 3 9bdc363e-f445-4904-8001-7f5a76b32a97-0_0-230-685_20241118011834881.parquet 3 Cathy {"age":28, "address":"Beijing"}

-- !renaming_complex_columns_table --
20241118011836377 20241118011836377_0_1 1 58382ae1-20ac-430d-a500-933817aa23ad-0_0-252-748_20241118011836377.parquet 1 Alice {"age":25, "location":"Guangzhou"}
20241118011836377 20241118011836377_0_0 2 58382ae1-20ac-430d-a500-933817aa23ad-0_0-252-748_20241118011836377.parquet 2 Bob {"age":30, "location":"Shanghai"}
20241118011836377 20241118011836377_0_2 3 58382ae1-20ac-430d-a500-933817aa23ad-0_0-252-748_20241118011836377.parquet 3 Cathy {"age":28, "location":"Beijing"}

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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("test_hudi_schema_evolution", "p2,external,hudi,external_remote,external_remote_hudi") {
String enabled = context.config.otherConfigs.get("enableExternalHudiTest")
if (enabled == null || !enabled.equalsIgnoreCase("true")) {
logger.info("disable hudi test")
}

String catalog_name = "test_hudi_schema_evolution"
String props = context.config.otherConfigs.get("hudiEmrCatalog")
sql """drop catalog if exists ${catalog_name};"""
sql """
create catalog if not exists ${catalog_name} properties (
${props}
);
"""

sql """ switch ${catalog_name};"""
sql """ use regression_hudi;"""
sql """ set enable_fallback_to_original_planner=false """

qt_adding_simple_columns_table """ select * from adding_simple_columns_table order by id """
qt_altering_simple_columns_table """ select * from altering_simple_columns_table order by id """
qt_deleting_simple_columns_table """ select * from deleting_simple_columns_table order by id """
qt_renaming_simple_columns_table """ select * from renaming_simple_columns_table order by id """

qt_adding_complex_columns_table """ select * from adding_complex_columns_table order by id """
qt_altering_complex_columns_table """ select * from altering_complex_columns_table order by id """
qt_deleting_complex_columns_table """ select * from deleting_complex_columns_table order by id """
qt_renaming_complex_columns_table """ select * from renaming_complex_columns_table order by id """

sql """drop catalog if exists ${catalog_name};"""
}

0 comments on commit 362f5fe

Please sign in to comment.