BiteTheDDDDt commented on code in PR #30151:
URL: https://github.com/apache/doris/pull/30151#discussion_r1495492338


##########
regression-test/suites/nereids_p0/sql_functions/table_function/explode_map.groovy:
##########
@@ -0,0 +1,55 @@
+// 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("explode_map") {
+    sql "SET enable_nereids_planner=true"
+    sql "SET enable_fallback_to_original_planner=false"
+
+    sql """ DROP TABLE IF EXISTS sdu """
+    sql """
+        CREATE TABLE IF NOT EXISTS `sdu`(
+                   `id` INT NULL,
+                   `name` TEXT NULL,
+                   `score` MAP<TEXT,INT> NULL
+                 ) ENGINE=OLAP
+                 DUPLICATE KEY(`id`)
+                 COMMENT 'OLAP'
+                 DISTRIBUTED BY HASH(`id`) BUCKETS 1
+                 PROPERTIES ("replication_allocation" = "tag.location.default: 
1");
+    """
+
+    // insert values
+    sql """ insert into sdu values (0, "zhangsan", 
{"Chinese":"80","Math":"60","English":"90"}); """
+    sql """ insert into sdu values (1, "lisi", {"null":null}); """
+    sql """ insert into sdu values (2, "wangwu", 
{"Chinese":"88","Math":"90","English":"96"}); """
+    sql """ insert into sdu values (3, "lisi2", {null:null}); """
+    sql """ insert into sdu values (4, "amory", NULL); """
+
+    qt_sql """ select * from sdu order by id; """
+    qt_explode_sql """ select name, k,v from sdu lateral view 
explode_map(score) tmp as k,v;"""

Review Comment:
   add order by



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