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

gabriellee 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 578a855b3e [Bug](topn-opt) filter condition for analytic info for two 
phase read opt (#16173)
578a855b3e is described below

commit 578a855b3e5e114e9fe94f2b8432ae6586aaf020
Author: lihangyu <15605149...@163.com>
AuthorDate: Sun Jan 29 12:06:18 2023 +0800

    [Bug](topn-opt) filter condition for analytic info for two phase read opt 
(#16173)
    
    two phase read optimization should not be enabled when query has analytic 
info
---
 .../java/org/apache/doris/analysis/SelectStmt.java |  3 +-
 .../string_functions/sql/analytic_query.out        | 79 ++++++++++++++++++++++
 .../string_functions/sql/analytic_query.sql        | 19 ++++++
 3 files changed, 100 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
index d2fb2636f2..399043555e 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/SelectStmt.java
@@ -667,7 +667,8 @@ public class SelectStmt extends QueryStmt {
         // Only handle the simplest `SELECT ... FROM <tbl> WHERE ... ORDER BY 
... LIMIT ...` query
         if (getAggInfo() != null
                 || getHavingPred() != null
-                || getWithClause() != null) {
+                || getWithClause() != null
+                || getAnalyticInfo() != null) {
             return false;
         }
         if (!analyzer.isRootAnalyzer()) {
diff --git 
a/regression-test/data/query_p0/sql_functions/string_functions/sql/analytic_query.out
 
b/regression-test/data/query_p0/sql_functions/string_functions/sql/analytic_query.out
new file mode 100644
index 0000000000..3807e5fcf9
--- /dev/null
+++ 
b/regression-test/data/query_p0/sql_functions/string_functions/sql/analytic_query.out
@@ -0,0 +1,79 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !analytic_query --
+4627   1830    257.82  4627    4627    1830    4627    257.82  257.82  5.7.99  
60
+4535   1201    218.04  4535    4535    1201    4535    218.04  218.04  5.7.99  
76
+2581   1971    931.05  2581    2581    1971    2581    931.05  931.05  5.7.99  
4
+3554   317     332.0   3554    3554    317     3554    332.0   332.0   5.7.99  
18
+5517   1658    968.84  5517    5517    1658    5517    968.84  968.84  5.7.99  
82
+8761   1053    106.7   8761    8761    1053    8761    106.7   106.7   5.7.99  
24
+2972   57      123.11  2972    2972    57      2972    123.11  123.11  5.7.99  
58
+717    254     564.77  717     717     254     717     564.77  564.77  5.7.99  
82
+1674   705     102.28  1674    1674    705     1674    102.28  102.28  5.7.99  
38
+796    971     318.79  796     796     971     796     318.79  318.79  5.7.99  
72
+6707   1634    372.29  6707    6707    1634    6707    372.29  372.29  5.7.99  
35
+4049   1872    447.75  4049    4049    1872    4049    447.75  447.75  5.7.99  
73
+8067   1376    912.31  8067    8067    1376    8067    912.31  912.31  5.7.99  
53
+2313   1214    438.22  2313    2313    1214    2313    438.22  438.22  5.7.99  
52
+5327   73      108.96  5327    5327    73      5327    108.96  108.96  5.7.99  
24
+5500   1821    882.5   5500    5500    1821    5500    882.5   882.5   5.7.99  
51
+1798   433     128.56  1798    1798    433     1798    128.56  128.56  5.7.99  
92
+5475   39      532.26  5475    5475    39      5475    532.26  532.26  5.7.99  
90
+6054   1606    486.42  6054    6054    1606    6054    486.42  486.42  5.7.99  
89
+6875   1082    826.47  6875    6875    1082    6875    826.47  826.47  5.7.99  
53
+3180   1873    629.18  3180    3180    1873    3180    629.18  629.18  5.7.99  
17
+3391   1793    588.68  3391    3391    1793    3391    588.68  588.68  5.7.99  
78
+517    964     517.38  517     517     964     517     517.38  517.38  5.7.99  
65
+4580   97      761.41  4580    4580    97      4580    761.41  761.41  5.7.99  
73
+8071   1390    612.13  8071    8071    1390    8071    612.13  612.13  5.7.99  
91
+7236   736     872.53  7236    7236    736     7236    872.53  872.53  5.7.99  
37
+3126   1403    173.62  3126    3126    1403    3126    173.62  173.62  5.7.99  
21
+9755   1053    189.42  9755    9755    1053    9755    189.42  189.42  5.7.99  
54
+9702   26      821.89  9702    9702    26      9702    821.89  821.89  5.7.99  
2
+2356   1188    841.79  2356    2356    1188    2356    841.79  841.79  5.7.99  
89
+626    747     91.87   626     626     747     626     91.87   91.87   5.7.99  
80
+1285   1518    335.15  1285    1285    1518    1285    335.15  335.15  5.7.99  
99
+8316   959     435.36  8316    8316    959     8316    435.36  435.36  5.7.99  
62
+2338   1228    658.94  2338    2338    1228    2338    658.94  658.94  5.7.99  
29
+8112   1860    215.52  8112    8112    1860    8112    215.52  215.52  5.7.99  
4
+8915   1134    839.18  8915    8915    1134    8915    839.18  839.18  5.7.99  
71
+1303   772     942.93  1303    1303    772     1303    942.93  942.93  5.7.99  
5
+3238   648     69.51   3238    3238    648     3238    69.51   69.51   5.7.99  
80
+2205   850     219.21  2205    2205    850     2205    219.21  219.21  5.7.99  
17
+1064   1589    439.88  1064    1064    1589    1064    439.88  439.88  5.7.99  
30
+3224   1958    829.21  3224    3224    1958    3224    829.21  829.21  5.7.99  
3
+7645   252     275.23  7645    7645    252     7645    275.23  275.23  5.7.99  
34
+1550   999     136.14  1550    1550    999     1550    136.14  136.14  5.7.99  
2
+3896   1292    924.38  3896    3896    1292    3896    924.38  924.38  5.7.99  
4
+7278   972     967.71  7278    7278    972     7278    967.71  967.71  5.7.99  
75
+753    1365    871.48  753     753     1365    753     871.48  871.48  5.7.99  
80
+5985   663     332.39  5985    5985    663     5985    332.39  332.39  5.7.99  
57
+7347   1747    461.67  7347    7347    1747    7347    461.67  461.67  5.7.99  
90
+352    536     143.93  352     352     536     352     143.93  143.93  5.7.99  
97
+2261   1794    157.22  2261    2261    1794    2261    157.22  157.22  5.7.99  
95
+3793   503     68.79   3793    3793    503     3793    68.79   68.79   5.7.99  
34
+282    1423    800.36  282     282     1423    282     800.36  800.36  5.7.99  
41
+1567   1809    991.6   1567    1567    1809    1567    991.6   991.6   5.7.99  
39
+7407   922     457.36  7407    7407    922     7407    457.36  457.36  5.7.99  
91
+5827   1159    645.53  5827    5827    1159    5827    645.53  645.53  5.7.99  
68
+5472   1602    547.06  5472    5472    1602    5472    547.06  547.06  5.7.99  
85
+6971   723     108.21  6971    6971    723     6971    108.21  108.21  5.7.99  
20
+6443   598     265.4   6443    6443    598     6443    265.4   265.4   5.7.99  
99
+3242   1392    673.51  3242    3242    1392    3242    673.51  673.51  5.7.99  
7
+2113   1953    148.78  2113    2113    1953    2113    148.78  148.78  5.7.99  
86
+7244   951     709.23  7244    7244    951     7244    709.23  709.23  5.7.99  
52
+2894   1367    951.21  2894    2894    1367    2894    951.21  951.21  5.7.99  
82
+9489   1873    405.31  9489    9489    1873    9489    405.31  405.31  5.7.99  
3
+2708   1566    571.65  2708    2708    1566    2708    571.65  571.65  5.7.99  
87
+1019   122     451.29  1019    1019    122     1019    451.29  451.29  5.7.99  
23
+1821   1906    386.55  1821    1821    1906    1821    386.55  386.55  5.7.99  
39
+5058   1712    338.6   5058    5058    1712    5058    338.6   338.6   5.7.99  
13
+1695   1776    138.16  1695    1695    1776    1695    138.16  138.16  5.7.99  
77
+3058   343     18.48   3058    3058    343     3058    18.48   18.48   5.7.99  
44
+6105   516     600.29  6105    6105    516     6105    600.29  600.29  5.7.99  
17
+7441   289     519.98  7441    7441    289     7441    519.98  519.98  5.7.99  
71
+341    889     931.12  341     341     889     341     931.12  931.12  5.7.99  
23
+1168   1301    624.73  1168    1168    1301    1168    624.73  624.73  5.7.99  
16
+2307   119     473.64  2307    2307    119     2307    473.64  473.64  5.7.99  
20
+4692   113     141.48  4692    4692    113     4692    141.48  141.48  5.7.99  
92
+1726   1111    22.72   1726    1726    1111    1726    22.72   22.72   5.7.99  
84
+
diff --git 
a/regression-test/suites/query_p0/sql_functions/string_functions/sql/analytic_query.sql
 
b/regression-test/suites/query_p0/sql_functions/string_functions/sql/analytic_query.sql
new file mode 100644
index 0000000000..60d7071818
--- /dev/null
+++ 
b/regression-test/suites/query_p0/sql_functions/string_functions/sql/analytic_query.sql
@@ -0,0 +1,19 @@
+SELECT /*+ SET_VAR(query_timeout = 600) */ ref_0.`availqty` AS c0,
+                                           ref_0.`partkey` AS c1,
+                                           coalesce(ref_0.`supplycost`, 
ref_0.`supplycost`) AS c2,
+                                           ref_0.`availqty` AS c3,
+                                           ref_0.`availqty` AS c4,
+                                           ref_0.`partkey` AS c5,
+                                           max(cast(ref_0.`availqty` AS int)) 
OVER (PARTITION BY ref_0.`supplycost`,
+                                                                               
                  ref_0.`comment`,
+                                                                               
                  ref_0.`partkey`
+                                                                               
     ORDER BY ref_0.`supplycost`) AS c6,
+                                                                               
    ref_0.`supplycost` AS c7,
+                                                                               
    ref_0.`supplycost` AS c8,
+                                                                               
    version() AS c9,
+                                                                               
    ref_0.`suppkey` AS c10
+FROM 
regression_test_query_p0_sql_functions_string_functions.tpch_tiny_partsupp AS 
ref_0
+WHERE TRUE
+ORDER BY ref_0.`comment`
+LIMIT 76
+OFFSET 120


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to