|
| 1 | +// Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +// or more contributor license agreements. See the NOTICE file |
| 3 | +// distributed with this work for additional information |
| 4 | +// regarding copyright ownership. The ASF licenses this file |
| 5 | +// to you under the Apache License, Version 2.0 (the |
| 6 | +// "License"); you may not use this file except in compliance |
| 7 | +// with the License. You may obtain a copy of the License at |
| 8 | +// |
| 9 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +// |
| 11 | +// Unless required by applicable law or agreed to in writing, |
| 12 | +// software distributed under the License is distributed on an |
| 13 | +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +// KIND, either express or implied. See the License for the |
| 15 | +// specific language governing permissions and limitations |
| 16 | +// under the License. |
| 17 | + |
| 18 | +// The cases is copied from https://github.com/trinodb/trino/tree/master |
| 19 | +// /testing/trino-product-tests/src/main/resources/sql-tests/testcases/aggregate |
| 20 | +// and modified by Doris. |
| 21 | + |
| 22 | +suite("test_probe_clean") { |
| 23 | + |
| 24 | +sql """ drop table IF EXISTS clearblocktable1; """ |
| 25 | +sql """ |
| 26 | + CREATE TABLE IF NOT EXISTS clearblocktable1 ( |
| 27 | + `col_int_undef_signed` INT NULL COMMENT "", |
| 28 | + `col_int_undef_signed_not_null` INT NOT NULL COMMENT "", |
| 29 | + `col_date_undef_signed_not_null` date(11) NOT NULL COMMENT "", |
| 30 | +
|
| 31 | + ) ENGINE=OLAP |
| 32 | + DUPLICATE KEY(`col_int_undef_signed`) |
| 33 | + DISTRIBUTED BY HASH(`col_int_undef_signed`) BUCKETS 1 |
| 34 | + PROPERTIES ( |
| 35 | + 'replication_num' = '1' |
| 36 | +); |
| 37 | +""" |
| 38 | + |
| 39 | + |
| 40 | +sql """ |
| 41 | +insert into clearblocktable1 values(1,1,'2020-01-01'); |
| 42 | +""" |
| 43 | +sql """ |
| 44 | +drop table IF EXISTS clearblocktable2; |
| 45 | +""" |
| 46 | +sql """ |
| 47 | +CREATE TABLE IF NOT EXISTS clearblocktable2 ( |
| 48 | + `col_int_undef_signed` INT NULL COMMENT "", |
| 49 | + `col_int_undef_signed_not_null` INT NOT NULL COMMENT "", |
| 50 | + `col_date_undef_signed_not_null` date(11) NOT NULL COMMENT "", |
| 51 | +
|
| 52 | + ) ENGINE=OLAP |
| 53 | + DUPLICATE KEY(`col_int_undef_signed`) |
| 54 | + DISTRIBUTED BY HASH(`col_int_undef_signed`) BUCKETS 1 |
| 55 | + PROPERTIES ( |
| 56 | + 'replication_num' = '1' |
| 57 | +); |
| 58 | +""" |
| 59 | + |
| 60 | +sql """ |
| 61 | +insert into clearblocktable2 values(1,1,'2020-01-01'); |
| 62 | +""" |
| 63 | + |
| 64 | +sql """ |
| 65 | +set enable_pipeline_x_engine=true, enable_pipeline_engine=true; |
| 66 | +""" |
| 67 | +qt_select_pipelineX """ |
| 68 | +
|
| 69 | +SELECT YEAR(ifnull(clearblocktable1.`col_date_undef_signed_not_null`, clearblocktable1.`col_date_undef_signed_not_null`)) AS field1 , |
| 70 | +CASE WHEN clearblocktable1.`col_int_undef_signed` != clearblocktable1.`col_int_undef_signed` * (8 + 1) THEN -5.2 ELSE clearblocktable1.`col_int_undef_signed` END AS field2 |
| 71 | +FROM clearblocktable1 INNER JOIN clearblocktable2 ON clearblocktable2.`col_int_undef_signed` = clearblocktable1.`col_int_undef_signed` WHERE clearblocktable1.`col_int_undef_signed_not_null` <> 7; |
| 72 | +
|
| 73 | +""" |
| 74 | + |
| 75 | +sql """ |
| 76 | +set enable_pipeline_x_engine=false,enable_pipeline_engine=true; |
| 77 | +""" |
| 78 | +qt_select_pipeline """ |
| 79 | +
|
| 80 | +SELECT YEAR(ifnull(clearblocktable1.`col_date_undef_signed_not_null`, clearblocktable1.`col_date_undef_signed_not_null`)) AS field1 , |
| 81 | +CASE WHEN clearblocktable1.`col_int_undef_signed` != clearblocktable1.`col_int_undef_signed` * (8 + 1) THEN -5.2 ELSE clearblocktable1.`col_int_undef_signed` END AS field2 |
| 82 | +FROM clearblocktable1 INNER JOIN clearblocktable2 ON clearblocktable2.`col_int_undef_signed` = clearblocktable1.`col_int_undef_signed` WHERE clearblocktable1.`col_int_undef_signed_not_null` <> 7; |
| 83 | +
|
| 84 | +""" |
| 85 | + |
| 86 | +sql """ |
| 87 | +set enable_pipeline_x_engine=false, enable_pipeline_engine=false; |
| 88 | +""" |
| 89 | +qt_select_non_pipeline """ |
| 90 | +
|
| 91 | +SELECT YEAR(ifnull(clearblocktable1.`col_date_undef_signed_not_null`, clearblocktable1.`col_date_undef_signed_not_null`)) AS field1 , |
| 92 | +CASE WHEN clearblocktable1.`col_int_undef_signed` != clearblocktable1.`col_int_undef_signed` * (8 + 1) THEN -5.2 ELSE clearblocktable1.`col_int_undef_signed` END AS field2 |
| 93 | +FROM clearblocktable1 INNER JOIN clearblocktable2 ON clearblocktable2.`col_int_undef_signed` = clearblocktable1.`col_int_undef_signed` WHERE clearblocktable1.`col_int_undef_signed_not_null` <> 7; |
| 94 | +""" |
| 95 | +} |
0 commit comments