This is an automated email from the ASF dual-hosted git repository.

jianliangqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 93059f3fff3 [test](inverted index) TopN Optimization Test for 
Composite Key. (#41952)
93059f3fff3 is described below

commit 93059f3fff348e9cdf495c4b55893029249e3208
Author: zzzxl <[email protected]>
AuthorDate: Thu Oct 17 20:40:47 2024 +0800

    [test](inverted index) TopN Optimization Test for Composite Key. (#41952)
    
    Prevent incorrect use of composite keys in TopN optimization, which
    could lead to performance degradation.
---
 .../test_topn_fault_injection.out                  |  6 ++++++
 .../test_topn_fault_injection.groovy               | 22 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git 
a/regression-test/data/fault_injection_p0/test_topn_fault_injection.out 
b/regression-test/data/fault_injection_p0/test_topn_fault_injection.out
index 7aab5b6a499..742413ad30d 100644
--- a/regression-test/data/fault_injection_p0/test_topn_fault_injection.out
+++ b/regression-test/data/fault_injection_p0/test_topn_fault_injection.out
@@ -59,3 +59,9 @@
 -- !sql --
 893964672      26.1.0.0        GET /images/hm_bg.jpg HTTP/1.0  200     24736
 
+-- !sql --
+893966413      34.0.0.0        GET /english/playing/body.html HTTP/1.0 200     
5033
+
+-- !sql --
+893966413      34.0.0.0        GET /english/playing/body.html HTTP/1.0 200     
5033
+
diff --git 
a/regression-test/suites/fault_injection_p0/test_topn_fault_injection.groovy 
b/regression-test/suites/fault_injection_p0/test_topn_fault_injection.groovy
index 73b4bc808f1..ebfdbf6e69c 100644
--- a/regression-test/suites/fault_injection_p0/test_topn_fault_injection.groovy
+++ b/regression-test/suites/fault_injection_p0/test_topn_fault_injection.groovy
@@ -19,6 +19,7 @@ suite("test_topn_fault_injection", "nonConcurrent") {
     // define a sql table
     def indexTbName1 = "test_topn_fault_injection1"
     def indexTbName2 = "test_topn_fault_injection2"
+    def indexTbName3 = "test_topn_fault_injection3"
 
     sql "DROP TABLE IF EXISTS ${indexTbName1}"
     sql """
@@ -61,6 +62,24 @@ suite("test_topn_fault_injection", "nonConcurrent") {
       );
     """
 
+    sql "DROP TABLE IF EXISTS ${indexTbName3}"
+    sql """
+      CREATE TABLE ${indexTbName3} (
+        `@timestamp` int(11) NULL COMMENT "",
+        `clientip` varchar(20) NULL COMMENT "",
+        `request` text NULL COMMENT "",
+        `status` int(11) NULL COMMENT "",
+        `size` int(11) NULL COMMENT ""
+      ) ENGINE=OLAP
+      DUPLICATE KEY(`@timestamp`, `clientip`)
+      COMMENT "OLAP"
+      DISTRIBUTED BY RANDOM BUCKETS 1
+      PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1",
+        "disable_auto_compaction" = "true"
+      );
+    """
+
     def load_httplogs_data = {table_name, label, read_flag, format_flag, 
file_name, ignore_failure=false,
                         expected_succ_rows = -1, load_to_single_tablet = 
'true' ->
 
@@ -94,6 +113,7 @@ suite("test_topn_fault_injection", "nonConcurrent") {
     try {
       load_httplogs_data.call(indexTbName1, 'test_topn_fault_injection1', 
'true', 'json', 'documents-1000.json')
       load_httplogs_data.call(indexTbName2, 'test_topn_fault_injection2', 
'true', 'json', 'documents-1000.json')
+      load_httplogs_data.call(indexTbName3, 'test_topn_fault_injection3', 
'true', 'json', 'documents-1000.json')
 
       sql "sync"
       sql """ set enable_common_expr_pushdown = true """
@@ -131,6 +151,8 @@ suite("test_topn_fault_injection", "nonConcurrent") {
         qt_sql """ select * from ${indexTbName2} where (`@timestamp` >= 
893964617 and `@timestamp` < 893966455) and (clientip match_phrase '1' or 
clientip match_phrase '3' and request like '%ag%') order by `@timestamp` limit 
1; """
         qt_sql """ select * from ${indexTbName2} where (`@timestamp` >= 
893964617 and `@timestamp` < 893966455) and (clientip match_phrase '1' or 
`@timestamp` = 1) order by `@timestamp` limit 1; """
         
+        qt_sql """ select * from ${indexTbName3} where (`@timestamp` >= 
893964617 and `@timestamp` < 893966455) and clientip = '34.0.0.0' order by 
`@timestamp` limit 1; """
+        qt_sql """ select * from ${indexTbName3} where clientip = '34.0.0.0' 
order by `@timestamp` limit 1; """
       } finally {
         
GetDebugPoint().disableDebugPointForAllBEs("segment_iterator.topn_opt_2")
       }


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

Reply via email to