starocean999 commented on code in PR #38166:
URL: https://github.com/apache/doris/pull/38166#discussion_r1687668286


##########
regression-test/suites/nereids_rules_p0/grouping_sets/grouping_alias_test.groovy:
##########
@@ -0,0 +1,80 @@
+// 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("grouping_alias_test"){
+    sql "SET enable_nereids_planner=true"
+    sql "SET enable_fallback_to_original_planner=false"
+    sql"drop table if exists grouping_alias_test_t"
+    sql """
+        CREATE TABLE grouping_alias_test_t (
+            id INT,
+            value1 INT,
+            value2 VARCHAR(50)
+        )distributed by hash(id) properties("replication_num"="1");
+    """
+    sql """
+    INSERT INTO grouping_alias_test_t (id, value1, value2) VALUES
+    (1, 10, 'A'),
+    (2, 20, 'B'),
+    (3, 30, 'C'),
+    (4, 40, 'D');
+    """
+
+    qt_alias "select id as c1 from grouping_alias_test_t group by grouping 
sets((id,value2),(id)) order by 1;"
+    qt_alias_grouping_scalar "select id as c1, grouping(id) from 
grouping_alias_test_t  group by grouping sets((id,value2),(id)) order by 1,2;"

Review Comment:
   we can add more test case like bellow:
   ` select id as c1, id, id as c3, grouping(id) from table1 group by grouping 
sets((c1, value2),(c3));`
   the alias in grouping sets



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