[regression-test](query) Add regression case of error could not be changed to nullabl when exe… (#15123)

* Add regression case of error could not be changed to nullabl when exeing sql

* add out file

Co-authored-by: smallhibiscus <844981280>
This commit is contained in:
Hong Liu
2022-12-16 21:57:36 +08:00
committed by GitHub
parent 4530b531e7
commit 33abe11dea
3 changed files with 61 additions and 0 deletions

View File

@ -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

View File

@ -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"
);

View File

@ -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;
"""
}