github-actions[bot] commented on code in PR #68804:
URL: https://github.com/apache/doris/pull/68804#discussion_r4226475521


##########
regression-test/suites/unique_with_mor_p0/test_read_mor_as_dup_key_topn.groovy:
##########
@@ -0,0 +1,52 @@
+// 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.
+
+// ORDER BY a key prefix with LIMIT on a MOR table listed in 
read_mor_as_dup_tables.
+// The table is read as DUP, so every version of a key is a row and the TopN 
sees all of them.
+suite("test_read_mor_as_dup_key_topn") {
+    sql "DROP TABLE IF EXISTS test_read_mor_as_dup_key_topn"
+    sql """
+        CREATE TABLE test_read_mor_as_dup_key_topn (
+            k1 INT NOT NULL,
+            k2 INT NOT NULL,
+            v INT NULL
+        ) ENGINE=OLAP
+        UNIQUE KEY(k1, k2)
+        DISTRIBUTED BY HASH(k1) BUCKETS 1
+        PROPERTIES (
+            "enable_unique_key_merge_on_write" = "false",
+            "disable_auto_compaction" = "true",
+            "replication_num" = "1"
+        )
+    """
+    // Three loads make three overlapping rowsets; key (1, 1) has three 
versions.
+    sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 10), (2, 2, 
20), (5, 5, 50)"
+    sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 11), (3, 3, 
30), (6, 6, 60)"
+    sql "INSERT INTO test_read_mor_as_dup_key_topn VALUES (1, 1, 12), (4, 4, 
40), (7, 7, 70)"
+
+    // Merged read: one row per key.
+    qt_merged "SELECT * FROM test_read_mor_as_dup_key_topn ORDER BY k1, k2 
LIMIT 3"
+
+    sql "SET read_mor_as_dup_tables = 'test_read_mor_as_dup_key_topn'"

Review Comment:
   [P2] Force segment LIMIT pushdown in this regression test. The P0 FE config 
enables fuzzy session variables, and `SessionVariable.initFuzzyModeVariables()` 
randomly sets `enableSegmentLimitPushdown` to false. In that case the scanner 
skips the storage TopN path before it reaches the new MOR-as-DUP guard, so this 
suite can pass against the old crashing behavior. Set 
`enable_segment_limit_pushdown=true` before these TopN queries so every run 
exercises the fix.



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