LiBinfeng-01 commented on code in PR #46624:
URL: https://github.com/apache/doris/pull/46624#discussion_r1908117014


##########
regression-test/suites/nereids_p0/ddl/clean/test_clean_label_nereids.groovy:
##########
@@ -0,0 +1,79 @@
+// 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_clean_label_nereids") {
+    String dbName = "nereids_clean_label"
+    String tableName1 = "test_table1"
+    String tableName2 = "test_table2"
+    String insertLabel = "label_" + System.currentTimeMillis()
+
+    sql """DROP TABLE IF EXISTS ${dbName}"""
+    sql """create database ${dbName}"""
+    sql """use ${dbName}"""
+    sql """
+            CREATE TABLE ${dbName}.${tableName1}(
+                user_id            BIGINT       NOT NULL ,
+                name               VARCHAR(20)           ,
+                age                INT
+            )
+            DUPLICATE KEY(user_id)
+            DISTRIBUTED BY HASH(user_id) BUCKETS 10
+            properties
+            (
+               "replication_num" = "1"
+            )
+            ;
+        """
+    sql """
+            CREATE TABLE ${dbName}.${tableName2}(
+                user_id            BIGINT       NOT NULL COMMENT "user id",
+                name               VARCHAR(20)           COMMENT "name",
+                age                INT                   COMMENT "age"
+            )
+            DUPLICATE KEY(user_id)
+            DISTRIBUTED BY HASH(user_id) BUCKETS 10
+            properties
+            (
+                "replication_num" = "1"
+            )
+            ;
+        """
+
+    sql """
+        INSERT INTO ${dbName}.${tableName1} (user_id, name, age)
+        VALUES (1, "Emily", 25),
+               (2, "Benjamin", 35),
+               (3, "Olivia", 28),
+               (4, "Alexander", 60),
+               (5, "Ava", 17);
+        """
+
+    sql """
+        insert into ${dbName}.${tableName2} with LABEL ${insertLabel} select * 
from ${dbName}.${tableName1};
+
+        """
+    sql """
+        INSERT INTO ${dbName}.${tableName2} (user_id, name, age)
+                VALUES (6, "Kevin", 30);
+        INSERT INTO ${dbName}.${tableName2} (user_id, name, age)
+                VALUES (7, "Simba", 31);
+        """
+    // clean label
+    checkNereidsExecute("clean label ${insertLabel} from ${dbName};")
+    checkNereidsExecute("clean label  from ${dbName};")
+    sql """drop database ${dbName}"""

Review Comment:
   should check if label is cleaned



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

Reply via email to