From 2bb4ea5dea5490d7c9e876dae5a83ef458519bdb Mon Sep 17 00:00:00 2001 From: slothever <18522955+wsjz@users.noreply.github.com> Date: Thu, 22 Dec 2022 13:45:07 +0800 Subject: [PATCH] [regresion-test](icebergv2) add icebergv2 test case (#15187) --- .../test_external_catalog_icebergv2.out | 27 +++++++++++ .../test_external_catalog_icebergv2.groovy | 47 +++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 regression-test/data/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.out create mode 100644 regression-test/suites/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.groovy diff --git a/regression-test/data/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.out b/regression-test/data/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.out new file mode 100644 index 0000000000..f5cb0464e4 --- /dev/null +++ b/regression-test/data/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.out @@ -0,0 +1,27 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !q01 -- +149990 + +-- !q02 -- +45132671 + +-- !q03 -- +0 + +-- !q04 -- +1 Customer#000000001 IVhzIApeRb ot,c,E 15 25-989-741-2988 711.56 BUILDING to the even, regular platelets. regular, ironic epitaphs nag e | +2 Customer#000000002 XSTf4,NCwDVaWNe6tEgvwfmRchLXak 13 23-768-687-3665 121.65 AUTOMOBILE l accounts. blithely ironic theodolites integrate boldly: caref | +3 Customer#000000003 MG9kdTD2WBHm 1 11-719-748-3364 7498.12 AUTOMOBILE deposits eat slyly ironic, even instructions. express foxes detect slyly. blithely even accounts abov | + +-- !q05 - +366778465 +366778561 +366778657 + +-- !q06 -- +10539361 +130424833 +2736865 + +-- !q07 -- +1499999990 \ No newline at end of file diff --git a/regression-test/suites/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.groovy b/regression-test/suites/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.groovy new file mode 100644 index 0000000000..473bd76fc8 --- /dev/null +++ b/regression-test/suites/external_table_emr_p2/iceberg/test_external_catalog_icebergv2.groovy @@ -0,0 +1,47 @@ +// 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_external_catalog_icebergv2", "p2") { + String enabled = context.config.otherConfigs.get("enableExternalHiveTest") + if (enabled != null && enabled.equalsIgnoreCase("true")) { + String extHiveHmsHost = context.config.otherConfigs.get("extHiveHmsHost") + String extHiveHmsPort = context.config.otherConfigs.get("extHiveHmsPort") + String catalog_name = "test_external_catalog_iceberg" + + sql """drop catalog if exists ${catalog_name};""" + sql """ + create catalog if not exists ${catalog_name} properties ( + 'type'='hms', + 'hive.metastore.uris' = 'thrift://${extHiveHmsHost}:${extHiveHmsPort}' + ); + """ + + sql """switch ${catalog_name};""" + // test parquet format format + def q01 = { + qt_q01 """ select count(1) as c from customer_small;""" + qt_q02 """ select count(1) from orders """ + qt_q03 """ select count(1) from customer_small where c_name = 'Customer#0063356' order by c_custkey limit 1; """ + qt_q04 """ select * from customer_small order by c_custkey limit 3 """ + qt_q05 """ select o_orderkey from orders where o_orderkey > 652566 limit 3""" + qt_q06 """ select o_orderkey from orders where o_custkey < 3357 limit 3""" + qt_q07 """ select count(1) as c from customer;""" + } + sql """ use `tpch_1000_icebergv2`; """ + q01() + } +}