yiguolei commented on code in PR #29242:
URL: https://github.com/apache/doris/pull/29242#discussion_r1437711587
##########
regression-test/suites/nereids_p0/explain/test_pushdown_explain.groovy:
##########
@@ -65,4 +65,54 @@ suite("test_pushdown_explain") {
sql("select count(cast(lo_orderkey as bigint)) from test_lineorder;")
contains "pushAggOp=COUNT"
}
+
+ sql "DROP TABLE IF EXISTS table_unique"
+ sql """
+ CREATE TABLE `table_unique` (
+ `user_id` LARGEINT NOT NULL COMMENT '\"用户id\"',
+ `username` VARCHAR(50) NOT NULL COMMENT '\"用户昵称\"'
+ ) ENGINE=OLAP
+ UNIQUE KEY(`user_id`, `username`)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(`user_id`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );
+ """
+
+ sql "set enable_pushdown_minmax_on_unique = true;"
+ explain {
+ sql("select min(user_id) from table_unique;")
+ contains "pushAggOp=MINMAX"
+ }
+ explain {
+ sql("select max(user_id) from table_unique;")
+ contains "pushAggOp=MINMAX"
+ }
+ explain {
+ sql("select min(username) from table_unique;")
+ contains "pushAggOp=MINMAX"
+ }
+ explain {
+ sql("select max(username) from table_unique;")
+ contains "pushAggOp=MINMAX"
+ }
Review Comment:
The regression test is tool simple.
Do not only test the plan.
Please create a mor table and insert some rows and do update and delete and
the select min max from table.
--
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]