XieJiann commented on code in PR #14880: URL: https://github.com/apache/doris/pull/14880#discussion_r1049158783
########## fe/fe-core/src/test/java/org/apache/doris/nereids/jobs/joinorder/TPCHTest.java: ########## @@ -0,0 +1,195 @@ +// 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. + +package org.apache.doris.nereids.jobs.joinorder; + +import org.apache.doris.nereids.util.PlanChecker; +import org.apache.doris.utframe.TestWithFeService; + +import org.junit.jupiter.api.Test; + +public class TPCHTest extends TestWithFeService { Review Comment: done ########## fe/fe-core/src/test/java/org/apache/doris/nereids/jobs/joinorder/TPCHTest.java: ########## @@ -0,0 +1,195 @@ +// 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. + +package org.apache.doris.nereids.jobs.joinorder; + +import org.apache.doris.nereids.util.PlanChecker; +import org.apache.doris.utframe.TestWithFeService; + +import org.junit.jupiter.api.Test; + +public class TPCHTest extends TestWithFeService { + @Override + protected void runBeforeAll() throws Exception { + createDatabase("test"); + connectContext.setDatabase("default_cluster:test"); + createTables("CREATE TABLE lineitem (\n" + + " l_shipdate DATEV2 NOT NULL,\n" + + " l_orderkey bigint NOT NULL,\n" + + " l_linenumber int not null,\n" + + " l_partkey int NOT NULL,\n" + + " l_suppkey int not null,\n" + + " l_quantity decimalv3(15, 2) NOT NULL,\n" + + " l_extendedprice decimalv3(15, 2) NOT NULL,\n" + + " l_discount decimalv3(15, 2) NOT NULL,\n" + + " l_tax decimalv3(15, 2) NOT NULL,\n" + + " l_returnflag VARCHAR(1) NOT NULL,\n" + + " l_linestatus VARCHAR(1) NOT NULL,\n" + + " l_commitdate DATEV2 NOT NULL,\n" + + " l_receiptdate DATEV2 NOT NULL,\n" + + " l_shipinstruct VARCHAR(25) NOT NULL,\n" + + " l_shipmode VARCHAR(10) NOT NULL,\n" + + " l_comment VARCHAR(44) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`l_shipdate`, `l_orderkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\",\n" + + " \"colocate_with\" = \"lineitem_orders\"\n" + + ");\n", + "CREATE TABLE orders (\n" + + " o_orderkey bigint NOT NULL,\n" + + " o_orderdate DATEV2 NOT NULL,\n" + + " o_custkey int NOT NULL,\n" + + " o_orderstatus VARCHAR(1) NOT NULL,\n" + + " o_totalprice decimalv3(15, 2) NOT NULL,\n" + + " o_orderpriority VARCHAR(15) NOT NULL,\n" + + " o_clerk VARCHAR(15) NOT NULL,\n" + + " o_shippriority int NOT NULL,\n" + + " o_comment VARCHAR(79) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`o_orderkey`, `o_orderdate`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`o_orderkey`) BUCKETS 96\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\",\n" + + " \"colocate_with\" = \"lineitem_orders\"\n" + + ");\n", + "CREATE TABLE partsupp (\n" + + " ps_partkey int NOT NULL,\n" + + " ps_suppkey int NOT NULL,\n" + + " ps_availqty int NOT NULL,\n" + + " ps_supplycost decimalv3(15, 2) NOT NULL,\n" + + " ps_comment VARCHAR(199) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`ps_partkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`ps_partkey`) BUCKETS 24\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\",\n" + + " \"colocate_with\" = \"part_partsupp\"\n" + + ");\n", + "CREATE TABLE part (\n" + + " p_partkey int NOT NULL,\n" + + " p_name VARCHAR(55) NOT NULL,\n" + + " p_mfgr VARCHAR(25) NOT NULL,\n" + + " p_brand VARCHAR(10) NOT NULL,\n" + + " p_type VARCHAR(25) NOT NULL,\n" + + " p_size int NOT NULL,\n" + + " p_container VARCHAR(10) NOT NULL,\n" + + " p_retailprice decimalv3(15, 2) NOT NULL,\n" + + " p_comment VARCHAR(23) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`p_partkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`p_partkey`) BUCKETS 24\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\",\n" + + " \"colocate_with\" = \"part_partsupp\"\n" + + ");\n", + "CREATE TABLE customer (\n" + + " c_custkey int NOT NULL,\n" + + " c_name VARCHAR(25) NOT NULL,\n" + + " c_address VARCHAR(40) NOT NULL,\n" + + " c_nationkey int NOT NULL,\n" + + " c_phone VARCHAR(15) NOT NULL,\n" + + " c_acctbal decimalv3(15, 2) NOT NULL,\n" + + " c_mktsegment VARCHAR(10) NOT NULL,\n" + + " c_comment VARCHAR(117) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`c_custkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`c_custkey`) BUCKETS 24\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\"\n" + + ");\n" + + "\n", + "CREATE TABLE supplier (\n" + + " s_suppkey int NOT NULL,\n" + + " s_name VARCHAR(25) NOT NULL,\n" + + " s_address VARCHAR(40) NOT NULL,\n" + + " s_nationkey int NOT NULL,\n" + + " s_phone VARCHAR(15) NOT NULL,\n" + + " s_acctbal decimalv3(15, 2) NOT NULL,\n" + + " s_comment VARCHAR(101) NOT NULL\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`s_suppkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`s_suppkey`) BUCKETS 12\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\"\n" + + ");\n" + + "\n", + "CREATE TABLE `nation` (\n" + + " `n_nationkey` int(11) NOT NULL,\n" + + " `n_name` varchar(25) NOT NULL,\n" + + " `n_regionkey` int(11) NOT NULL,\n" + + " `n_comment` varchar(152) NULL\n" + + ") ENGINE=OLAP\n" + + "DUPLICATE KEY(`N_NATIONKEY`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`N_NATIONKEY`) BUCKETS 1\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\"\n" + + ");\n", + "CREATE TABLE region (\n" + + " r_regionkey int NOT NULL,\n" + + " r_name VARCHAR(25) NOT NULL,\n" + + " r_comment VARCHAR(152)\n" + + ")ENGINE=OLAP\n" + + "DUPLICATE KEY(`r_regionkey`)\n" + + "COMMENT \"OLAP\"\n" + + "DISTRIBUTED BY HASH(`r_regionkey`) BUCKETS 1\n" + + "PROPERTIES (\n" + + " \"replication_num\" = \"1\"\n" + + ");\n" + ); + } + + @Test + void testQ5() { Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org