forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](Nereids) mow with sync mv could not be deleted (apache#39578)
before this PR will throw exception: Unknown column
- Loading branch information
Showing
3 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
regression-test/suites/delete_p0/test_delete_with_sync_mv.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// 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_delete_with_sync_mv") { | ||
|
||
sql """drop table if exists test_delete_with_sync_mv""" | ||
|
||
sql """ | ||
CREATE TABLE `test_delete_with_sync_mv` ( | ||
`l_orderkey` BIGINT NULL, | ||
`l_linenumber` INT NULL, | ||
`l_partkey` INT NULL, | ||
`l_suppkey` INT NULL, | ||
`l_shipdate` DATE not NULL, | ||
`l_quantity` DECIMAL(15, 2) NULL, | ||
`l_extendedprice` DECIMAL(15, 2) NULL, | ||
`l_discount` DECIMAL(15, 2) NULL, | ||
`l_tax` DECIMAL(15, 2) NULL, | ||
`l_returnflag` VARCHAR(1) NULL, | ||
`l_linestatus` VARCHAR(1) NULL, | ||
`l_commitdate` DATE NULL, | ||
`l_receiptdate` DATE NULL, | ||
`l_shipinstruct` VARCHAR(25) NULL, | ||
`l_shipmode` VARCHAR(10) NULL, | ||
`l_comment` VARCHAR(44) NULL | ||
) | ||
unique KEY(l_orderkey, l_linenumber, l_partkey, l_suppkey, l_shipdate) | ||
DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96 | ||
PROPERTIES ( | ||
"replication_num" = "1", | ||
"enable_unique_key_merge_on_write" = "true" | ||
); | ||
""" | ||
|
||
sql """ | ||
insert into test_delete_with_sync_mv values | ||
(null, 1, 2, 3, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy'), | ||
(1, null, 3, 1, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-18', '2023-10-18', 'a', 'b', 'yyyyyyyyy'), | ||
(3, 3, null, 2, '2023-10-19', 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', '2023-10-19', 'c', 'd', 'xxxxxxxxx'), | ||
(1, 2, 3, null, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy'), | ||
(2, 3, 2, 1, '2023-10-18', 5.5, 6.5, 7.5, 8.5, 'o', 'k', null, '2023-10-18', 'a', 'b', 'yyyyyyyyy'), | ||
(3, 1, 1, 2, '2023-10-19', 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', null, 'c', 'd', 'xxxxxxxxx'), | ||
(1, 3, 2, 2, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy'), | ||
(null, 1, 2, 3, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy'), | ||
(1, null, 3, 1, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-18', '2023-10-18', 'a', 'b', 'yyyyyyyyy'), | ||
(3, 3, null, 2, '2023-10-19', 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', '2023-10-19', 'c', 'd', 'xxxxxxxxx'), | ||
(1, 2, 3, null, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy'), | ||
(2, 3, 2, 1, '2023-10-18', 5.5, 6.5, 7.5, 8.5, 'o', 'k', null, '2023-10-18', 'a', 'b', 'yyyyyyyyy'), | ||
(3, 1, 1, 2, '2023-10-19', 7.5, 8.5, 9.5, 10.5, 'k', 'o', '2023-10-19', null, 'c', 'd', 'xxxxxxxxx'), | ||
(1, 3, 2, 2, '2023-10-17', 5.5, 6.5, 7.5, 8.5, 'o', 'k', '2023-10-17', '2023-10-17', 'a', 'b', 'yyyyyyyyy') | ||
""" | ||
|
||
createMV (""" | ||
CREATE MATERIALIZED VIEW mv | ||
AS | ||
select l_orderkey, l_linenumber, l_partkey, l_suppkey, l_shipdate, | ||
substring(concat(l_returnflag, l_linestatus), 1) | ||
from test_delete_with_sync_mv; | ||
""") | ||
|
||
sql """delete from test_delete_with_sync_mv where l_orderkey = 2""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters