forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](multi-catalog) Fix be crashed when query hive table after schem…
…a changed(new column added). (apache#20537) Fix be crashed when query hive table after schema changed(new column added). Regression Test: test_hive_schema_evolution.groovy
- Loading branch information
1 parent
41d7c53
commit 4faee4d
Showing
4 changed files
with
150 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
regression-test/data/external_table_emr_p2/hive/test_hive_schema_evolution.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !q01 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T13:01:03 | ||
|
||
-- !q02 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T13:01:03 | ||
|
||
-- !q03 -- | ||
\N | ||
2023-01-01T13:01:03 | ||
|
||
-- !q01 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T21:01:03 | ||
|
||
-- !q02 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T21:01:03 | ||
|
||
-- !q03 -- | ||
\N | ||
2023-01-01T21:01:03 | ||
|
||
-- !q01 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T13:01:03 | ||
|
||
-- !q02 -- | ||
1 kaka \N | ||
2 messi 2023-01-01T13:01:03 | ||
|
||
-- !q03 -- | ||
\N | ||
2023-01-01T13:01:03 | ||
|
75 changes: 75 additions & 0 deletions
75
regression-test/suites/external_table_emr_p2/hive/test_hive_schema_evolution.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// 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_hive_schema_evolution", "p0") { | ||
def q_text = { | ||
qt_q01 """ | ||
select * from schema_evo_test_text order by id; | ||
""" | ||
qt_q02 """ | ||
select id, name, ts from schema_evo_test_text order by id; | ||
""" | ||
qt_q03 """ | ||
select ts from schema_evo_test_text order by id; | ||
""" | ||
} | ||
|
||
def q_parquet = { | ||
qt_q01 """ | ||
select * from schema_evo_test_parquet order by id; | ||
""" | ||
qt_q02 """ | ||
select id, name, ts from schema_evo_test_parquet order by id; | ||
""" | ||
qt_q03 """ | ||
select ts from schema_evo_test_parquet order by id; | ||
""" | ||
} | ||
|
||
def q_orc = { | ||
qt_q01 """ | ||
select * from schema_evo_test_orc order by id; | ||
""" | ||
qt_q02 """ | ||
select id, name, ts from schema_evo_test_orc order by id; | ||
""" | ||
qt_q03 """ | ||
select ts from schema_evo_test_orc order by id; | ||
""" | ||
} | ||
|
||
String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
try { | ||
String hms_port = context.config.otherConfigs.get("hms_port") | ||
String catalog_name = "test_hive_schema_evolution" | ||
sql """drop catalog if exists ${catalog_name}""" | ||
sql """create catalog if not exists ${catalog_name} properties ( | ||
"type"="hms", | ||
'hive.metastore.uris' = 'thrift://127.0.0.1:${hms_port}' | ||
);""" | ||
sql """use `${catalog_name}`.`default`""" | ||
|
||
q_text() | ||
q_parquet() | ||
q_orc() | ||
|
||
sql """drop catalog if exists ${catalog_name}""" | ||
} finally { | ||
} | ||
} | ||
} |