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](tvf) fix FE cannot start when replay
alter view from tvf
(apa…
- Loading branch information
Showing
6 changed files
with
208 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
45 changes: 45 additions & 0 deletions
45
regression-test/data/external_table_p0/tvf/upgrade/test.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,45 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !create_view -- | ||
0 | ||
1 | ||
10 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
11 | ||
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
|
||
-- !alter_view -- | ||
0 | ||
1 | ||
10 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
11 | ||
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
|
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
55 changes: 55 additions & 0 deletions
55
regression-test/suites/external_table_p0/tvf/upgrade/load.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,55 @@ | ||
// 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_tvf_upgrade_load", "p0,external,hive,external_docker,external_docker_hive,restart_fe,upgrade_case") { | ||
String hdfs_port = context.config.otherConfigs.get("hive2HdfsPort") | ||
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
||
// It's okay to use random `hdfsUser`, but can not be empty. | ||
def hdfsUserName = "doris" | ||
def format = "csv" | ||
def defaultFS = "hdfs://${externalEnvIp}:${hdfs_port}" | ||
def uri = "" | ||
|
||
String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
// test create view from tvf and alter view from tvf | ||
uri = "${defaultFS}" + "/user/doris/preinstalled_data/csv_format_test/all_types.csv" | ||
format = "csv" | ||
sql """ DROP VIEW IF EXISTS test_hdfs_tvf_create_view;""" | ||
sql """ | ||
create view test_hdfs_tvf_create_view as | ||
select * from HDFS( | ||
"uri" = "${uri}", | ||
"hadoop.username" = "${hdfsUserName}", | ||
"column_separator" = ",", | ||
"format" = "${format}") order by c1; | ||
""" | ||
logger.info("View test_hdfs_tvf_create_view created") | ||
|
||
|
||
sql """ | ||
alter view test_hdfs_tvf_create_view as | ||
select c1 from HDFS( | ||
"uri" = "${uri}", | ||
"hadoop.username" = "${hdfsUserName}", | ||
"column_separator" = ",", | ||
"format" = "${format}") order by c1; | ||
""" | ||
logger.info("View test_hdfs_tvf_create_view altered") | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
regression-test/suites/external_table_p0/tvf/upgrade/test.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,34 @@ | ||
// 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_tvf_upgrade_test", "p0,external,hive,external_docker,external_docker_hive,restart_fe,upgrade_case") { | ||
String hdfs_port = context.config.otherConfigs.get("hive2HdfsPort") | ||
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
||
// It's okay to use random `hdfsUser`, but can not be empty. | ||
def hdfsUserName = "doris" | ||
def format = "csv" | ||
def defaultFS = "hdfs://${externalEnvIp}:${hdfs_port}" | ||
def uri = "" | ||
|
||
String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
order_qt_create_view """ select * from test_hdfs_tvf_create_view order by c1 limit 20; """ | ||
|
||
order_qt_alter_view """ select * from test_hdfs_tvf_create_view order by c1 limit 20; """ | ||
} | ||
} |