From 33abe11dea8b8dfddcb6d57d045c6b87fc6beb7f Mon Sep 17 00:00:00 2001 From: Hong Liu <844981280@qq.com> Date: Fri, 16 Dec 2022 21:57:36 +0800 Subject: [PATCH] =?UTF-8?q?[regression-test](query)=20Add=20regression=20c?= =?UTF-8?q?ase=20of=20error=20could=20not=20be=20changed=20to=20nullabl=20?= =?UTF-8?q?when=20exe=E2=80=A6=20(#15123)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add regression case of error could not be changed to nullabl when exeing sql * add out file Co-authored-by: smallhibiscus <844981280> --- .../data/query_p0/join/test_left_join1.out | 7 ++++ .../query_p0/join/ddl/test_left_join1.sql | 12 ++++++ .../query_p0/join/test_left_join1.groovy | 42 +++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 regression-test/data/query_p0/join/test_left_join1.out create mode 100644 regression-test/suites/query_p0/join/ddl/test_left_join1.sql create mode 100644 regression-test/suites/query_p0/join/test_left_join1.groovy diff --git a/regression-test/data/query_p0/join/test_left_join1.out b/regression-test/data/query_p0/join/test_left_join1.out new file mode 100644 index 0000000000..7f19a1333e --- /dev/null +++ b/regression-test/data/query_p0/join/test_left_join1.out @@ -0,0 +1,7 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select -- +1 123 1 123 \N \N +2 124 2 124 2 124 +3 125 3 125 3 125 +4 126 4 126 4 126 + diff --git a/regression-test/suites/query_p0/join/ddl/test_left_join1.sql b/regression-test/suites/query_p0/join/ddl/test_left_join1.sql new file mode 100644 index 0000000000..1ecda88e6d --- /dev/null +++ b/regression-test/suites/query_p0/join/ddl/test_left_join1.sql @@ -0,0 +1,12 @@ +CREATE TABLE `test_left_join1` ( + `f_key` bigint(10) NOT NULL DEFAULT "0" COMMENT "key", + `f_value` bigint(10) REPLACE_IF_NOT_NULL NULL COMMENT "value" +) ENGINE=OLAP +AGGREGATE KEY(`f_key`) +COMMENT "向量引擎bug展示" +DISTRIBUTED BY HASH(`f_key`) BUCKETS 2 +PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2" +); diff --git a/regression-test/suites/query_p0/join/test_left_join1.groovy b/regression-test/suites/query_p0/join/test_left_join1.groovy new file mode 100644 index 0000000000..d4cbeeee65 --- /dev/null +++ b/regression-test/suites/query_p0/join/test_left_join1.groovy @@ -0,0 +1,42 @@ +// 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_left_join1", "query,p0") { + + def tableName = "test_left_join1" + sql """drop table if exists ${tableName}""" + sql new File("""${context.file.parent}/ddl/test_left_join1.sql""").text + + sql """insert into ${tableName} values (1, 123),(2, 124),(3, 125),(4, 126);""" + + qt_select """ SELECT + * + FROM + ( SELECT f_key, f_value FROM ${tableName} ) a + LEFT JOIN ( SELECT f_key, f_value FROM ${tableName} ) b ON a.f_key = b.f_key + LEFT JOIN ( + SELECT + * + FROM + ${tableName} + WHERE + f_key IN ( SELECT f_key FROM ${tableName} WHERE f_key IN ( SELECT f_key FROM ${tableName} WHERE f_value > 123 ) ) + ) c ON a.f_key = c.f_key + ORDER BY + a.f_key; + """ +}