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.
[test](hive catalog)add hive catalog test case (apache#14217)
- Loading branch information
Showing
16 changed files
with
324 additions
and
1 deletion.
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
2 changes: 2 additions & 0 deletions
2
docker/thirdparties/docker-compose/hive/scripts/data_case/account_fund/data_file
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,2 @@ | ||
batchno,appsheet_no,filedate,t_no,tano,t_name,chged_no,mob_no2,home_no,off_no | ||
off_no,home_no,mob_no2,chged_no,t_name,tano,t_no,filedate,appsheet_no,batchno |
2 changes: 2 additions & 0 deletions
2
docker/thirdparties/docker-compose/hive/scripts/data_case/hive01/data_file
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,2 @@ | ||
1993,newguan,1,12344321 | ||
1994,newguan1,2,12344321 |
4 changes: 4 additions & 0 deletions
4
docker/thirdparties/docker-compose/hive/scripts/data_case/lineorder/data_file
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,4 @@ | ||
1,2,3,4,5,6,abc,7,8,9,10,11,12,13,14,15,bcd | ||
2,3,4,5,6,7,abc,8,9,10,11,12,13,14,15,16,bcd | ||
3,4,5,6,7,8,abc,9,10,11,12,13,14,15,16,17,bcd | ||
4,5,6,7,8,9,abc,10,11,12,13,14,15,16,17,18,bcd |
2 changes: 2 additions & 0 deletions
2
docker/thirdparties/docker-compose/hive/scripts/data_case/sale_table/data_file
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,2 @@ | ||
bill_code,dates,ord_year,ord_month,ord_quarter,on_time | ||
bill_code1,dates2,ord_year3,ord_month4,ord_quarter5,on_time6 |
3 changes: 3 additions & 0 deletions
3
docker/thirdparties/docker-compose/hive/scripts/data_case/string_table/data_file
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,3 @@ | ||
p_partkey0,p_name0,p_mfgr0,p_brand0,p_type0,p_size0,p_con0,p_r_price0,p_comment0 | ||
p_partkey1,p_name1,p_mfgr1,p_brand1,p_type1,p_size1,p_con1,p_r_price1,p_comment1 | ||
p_partkey2,p_name2,p_mfgr2,p_brand2,p_type2,p_size2,p_con2,p_r_price2,p_comment2 |
2 changes: 2 additions & 0 deletions
2
docker/thirdparties/docker-compose/hive/scripts/data_case/student/data_file
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,2 @@ | ||
123,zhangsan,12,m,abcdefg,13012345678 | ||
124,lisi,13,f,abcdefh,13056781234 |
2 changes: 2 additions & 0 deletions
2
docker/thirdparties/docker-compose/hive/scripts/data_case/t_hive/data_file
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,2 @@ | ||
12,k2,2022-01-01,k5,12.3 | ||
12,k3,2022-12-31,k6,23.4 |
4 changes: 4 additions & 0 deletions
4
docker/thirdparties/docker-compose/hive/scripts/data_case/test1/data_file
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,4 @@ | ||
123,china,4,56,sc | ||
234,america,5,67,ls | ||
345,cana,4,56,fy | ||
567,fre,7,89,pa |
3 changes: 3 additions & 0 deletions
3
docker/thirdparties/docker-compose/hive/scripts/data_case/test2/data_file
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,3 @@ | ||
123,zhangsan,12,123.45,2022-01-01 | ||
124,lisi,12,123.45,2022-01-01 | ||
125,lisan,12,123.45,2022-01-02 |
4 changes: 4 additions & 0 deletions
4
docker/thirdparties/docker-compose/hive/scripts/data_case/test_hive_doris/data_file
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,4 @@ | ||
a123,12 | ||
a124,13 | ||
a125,14 | ||
a126,15 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1091,4 +1091,3 @@ insert into doris_test.ex_tb13 values | |
('张三7',11,'123445167','123','321312','1998-02-13','中国','男',false); | ||
|
||
|
||
|
65 changes: 65 additions & 0 deletions
65
regression-test/data/hive_catalog_p0/hive_catalog_case.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,65 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !show_tables -- | ||
account_fund | ||
customer | ||
hive01 | ||
lineitem | ||
lineorder | ||
nation | ||
orc_all_types | ||
orders | ||
part | ||
partition_table | ||
partsupp | ||
region | ||
sale_table | ||
string_table | ||
student | ||
supplier | ||
t_hive | ||
test1 | ||
test2 | ||
test_hive_doris | ||
|
||
-- !q24 -- | ||
zhangsan 1 | ||
lisi 1 | ||
|
||
-- !q25 -- | ||
1 1 | ||
2 1 | ||
3 1 | ||
4 1 | ||
|
||
-- !q26 -- | ||
123 china 4 56 sc | ||
234 america 5 67 ls | ||
345 cana 4 56 fy | ||
567 fre 7 89 pa | ||
|
||
-- !q27 -- | ||
p_partkey2 p_name2 p_mfgr2 p_brand2 p_type2 p_size2 p_con2 p_r_price2 p_comment2 | ||
p_partkey1 p_name1 p_mfgr1 p_brand1 p_type1 p_size1 p_con1 p_r_price1 p_comment1 | ||
p_partkey0 p_name0 p_mfgr0 p_brand0 p_type0 p_size0 p_con0 p_r_price0 p_comment0 | ||
|
||
-- !q28 -- | ||
batchno appsheet_no filedate t_no tano t_name chged_no mob_no2 home_no off_no | ||
off_no home_no mob_no2 chged_no t_name tano t_no filedate appsheet_no batchno | ||
|
||
-- !q29 -- | ||
bill_code dates ord_year ord_month ord_quarter on_time | ||
|
||
-- !q30 -- | ||
2 | ||
|
||
-- !q31 -- | ||
123 zhangsan 12 123.45 2022-01-01 | ||
124 lisi 12 123.45 2022-01-01 | ||
125 lisan 12 123.45 2022-01-02 | ||
|
||
-- !q32 -- | ||
a123 12 | ||
a124 13 | ||
a125 14 | ||
a126 15 | ||
|
80 changes: 80 additions & 0 deletions
80
regression-test/suites/hive_catalog_p0/hive_catalog_case.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,80 @@ | ||
// 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("hive_catalog_case", "p0") { | ||
|
||
def q01 = { | ||
qt_q24 """ select name, count(1) as c from student group by name order by c desc;""" | ||
qt_q25 """ select lo_orderkey, count(1) as c from lineorder group by lo_orderkey order by c desc;""" | ||
qt_q26 """ select * from test1 order by col_1;""" | ||
qt_q27 """ select * from string_table order by p_partkey desc;""" | ||
qt_q28 """ select * from account_fund order by batchno;""" | ||
qt_q29 """ select * from sale_table order by bill_code limit 01;""" | ||
qt_q30 """ select count(card_cnt) from hive01;""" | ||
qt_q31 """ select * from test2 order by id;""" | ||
qt_q32 """ select * from test_hive_doris order by id;""" | ||
} | ||
|
||
|
||
def set_be_config = { -> | ||
String[][] backends = sql """ show backends; """ | ||
assertTrue(backends.size() > 0) | ||
for (String[] backend in backends) { | ||
// No need to set this config anymore, but leave this code sample here | ||
// StringBuilder setConfigCommand = new StringBuilder(); | ||
// setConfigCommand.append("curl -X POST http://") | ||
// setConfigCommand.append(backend[2]) | ||
// setConfigCommand.append(":") | ||
// setConfigCommand.append(backend[5]) | ||
// setConfigCommand.append("/api/update_config?") | ||
// String command1 = setConfigCommand.toString() + "enable_new_load_scan_node=true" | ||
// logger.info(command1) | ||
// String command2 = setConfigCommand.toString() + "enable_new_file_scanner=true" | ||
// logger.info(command2) | ||
// def process1 = command1.execute() | ||
// int code = process1.waitFor() | ||
// assertEquals(code, 0) | ||
// def process2 = command2.execute() | ||
// code = process1.waitFor() | ||
// assertEquals(code, 0) | ||
} | ||
} | ||
|
||
String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
String hms_port = context.config.otherConfigs.get("hms_port") | ||
set_be_config.call() | ||
|
||
sql """admin set frontend config ("enable_multi_catalog" = "true")""" | ||
sql """drop catalog if exists hive""" | ||
sql """ | ||
create catalog hive properties ( | ||
"type"="hms", | ||
'hive.metastore.uris' = 'thrift://127.0.0.1:${hms_port}' | ||
); | ||
""" | ||
sql """switch hive""" | ||
sql """use `default`""" | ||
order_qt_show_tables """show tables""" | ||
|
||
q01() | ||
} | ||
} | ||
|
||
|
||
|
||
|