morrySnow commented on code in PR #36150:
URL: https://github.com/apache/doris/pull/36150#discussion_r1637395158


##########
regression-test/suites/nereids_p0/insert_into_table/insert_cte.groovy:
##########
@@ -0,0 +1,67 @@
+// 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("insert_cte") {
+    def t1 = "insert_cte_tbl_1"
+    def t2 = "insert_cte_tbl_2"
+    def t3 = "insert_cte_tbl_3"
+
+    sql " SET enable_nereids_planner = true; "
+
+    sql """ DROP TABLE IF EXISTS $t1 """
+    sql """
+        create table $t1 (
+            k int
+        ) engine = OLAP
+        unique key(k)
+        partition by list (k)
+        (
+        partition p1 values in ("1", "2", "3"),
+        partition p2 values in ("4", "5", "6")
+        )
+        distributed by hash(k) buckets 3
+        properties("replication_num" = "1");
+    """
+    sql """ DROP TABLE IF EXISTS $t2 """
+    sql """
+        create table $t2 (
+            k int
+        ) properties("replication_num" = "1");
+    """
+
+    sql """ insert into $t2 values (1), (2), (3), (4), (5), (6); """
+
+    // test for InsertIntoTableCommand
+    // 1. insert into select
+    sql """ with cte1 as (select * from $t2 where k < 4) insert into $t1 
select * from cte1; """

Review Comment:
   add a case: `cte + insert into values` to ensure normalizePlan could work as 
expected



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to