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

morningman 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 e9f105aa1e [enhancement](regression-test) add some p0 cases (#12243)
e9f105aa1e is described below

commit e9f105aa1e69f8cae2d5c82bcd7013adf75ec21f
Author: Yongqiang YANG <98214048+dataroar...@users.noreply.github.com>
AuthorDate: Sun Sep 18 17:36:08 2022 +0800

    [enhancement](regression-test) add some p0 cases (#12243)
---
 regression-test/data/insert_p0/datetype.csv        |  16 ++
 regression-test/data/insert_p0/insert.out          | 204 +++++++++++++++++++++
 .../query_p0/limit/sql/predicateNotProjected.out   |   6 +
 .../limit/sql/useRestrictiveLimitFromSubq.out      |   4 +
 .../data/query_p0/limit/sql/withGroupBy.out        |   5 +
 .../limit/sql/withGroupByAndOrderByInSubq.out      |   5 +
 .../data/query_p0/limit/sql/withGroupByInSubq.out  |   4 +
 .../data/query_p0/limit/sql/withJoinInSubq.out     |   4 +
 .../data/query_p0/limit/sql/withLimitZero.out      |   4 +
 .../data/query_p0/limit/sql/withSimpleLimit.out    |   8 +
 .../data/query_p0/limit/sql/withSubq.out           |   4 +
 .../select_no_from/sql/projectConstants.out        |   4 +
 .../select_no_from/sql/projectFunctions.out        |   4 +
 .../query_p0/select_no_from/sql/withUnionAll.out   |   7 +
 .../query_p0/set_operations/sql/except_1_order.out |   6 +
 .../query_p0/set_operations/sql/except_2_order.out |   6 +
 .../query_p0/set_operations/sql/except_3_order.out |   8 +
 .../set_operations/sql/intersect_1_order.out       |   9 +
 .../set_operations/sql/intersect_2_order.out       |  10 +
 regression-test/suites/insert_p0/ddl/datatype.sql  |  15 ++
 .../suites/insert_p0/ddl/mutable_datatype.sql      |  15 ++
 regression-test/suites/insert_p0/insert.groovy     |  85 +++++++++
 .../suites/query_p0/aggregate/aggregate.groovy     |   1 +
 .../suites/query_p0/limit/ddl/lineitem.sql         |  18 ++
 .../suites/query_p0/limit/ddl/nation.sql           |  12 ++
 regression-test/suites/query_p0/limit/ddl/part.sql |  11 ++
 .../suites/query_p0/limit/ddl/partsupp.sql         |   7 +
 .../suites/query_p0/limit/ddl/region.sql           |  10 +
 .../suites/query_p0/limit/ddl/supplier.sql         |   9 +
 .../suites/query_p0/limit/ddl/workers.sql          |  10 +
 regression-test/suites/query_p0/limit/load.groovy  |  63 +++++++
 .../query_p0/limit/sql/predicateNotProjected.sql   |   3 +
 .../limit/sql/useRestrictiveLimitFromSubq.sql      |   2 +
 .../suites/query_p0/limit/sql/withGroupBy.sql      |   4 +
 .../limit/sql/withGroupByAndOrderByInSubq.sql      |   4 +
 .../query_p0/limit/sql/withGroupByInSubq.sql       |   4 +
 .../suites/query_p0/limit/sql/withJoinInSubq.sql   |   1 +
 .../suites/query_p0/limit/sql/withLimitZero.sql    |   3 +
 .../suites/query_p0/limit/sql/withSimpleLimit.sql  |   2 +
 .../suites/query_p0/limit/sql/withSubq.sql         |   2 +
 .../select_no_from/sql/projectAggFuncs.sql         |   4 +
 .../select_no_from/sql/projectConstants.sql        |   2 +
 .../select_no_from/sql/projectFunctions.sql        |   2 +
 .../select_no_from/sql/withGroupOrderHaving.sql    |   4 +
 .../query_p0/select_no_from/sql/withUnionAll.sql   |   8 +
 .../select_no_from/sql/withWhereClause.sql         |   4 +
 .../query_p0/select_no_from/sql/withWhereFalse.sql |   4 +
 47 files changed, 627 insertions(+)

diff --git a/regression-test/data/insert_p0/datetype.csv 
b/regression-test/data/insert_p0/datetype.csv
new file mode 100644
index 0000000000..a57e5ca7d1
--- /dev/null
+++ b/regression-test/data/insert_p0/datetype.csv
@@ -0,0 +1,16 @@
+12|12.25|String1|1999-01-08|1999-01-08 
02:05:06|TRUE|123.22|12345678901234567890.0123456789
+25|55.52|test|1952-01-05|1989-01-08 
04:05:06|FALSE|321.21|-12345678901234567890.0123456789
+964|0.245|Again|1936-02-08|2005-01-09 
04:05:06|FALSE|333.82|98765432109876543210.9876543210
+100|12.25|testing|1949-07-08|2002-01-07 
01:05:06|TRUE|-393.22|-98765432109876543210.9876543210
+100|99.8777|AGAIN|1987-04-09|2010-01-02 
04:03:06|TRUE|000.00|00000000000000000000.0000000000
+5252|12.25|sample|1987-04-09|2010-01-02 
04:03:06|TRUE|123.00|00000000000000000001.0000000000
+100|9.8777|STRING1|1923-04-08|2010-01-02 
05:09:06|TRUE|010.01|00000000000000000002.0000000000
+8996|98.8777|again|1987-04-09|2010-01-02 
04:03:06|FALSE|-000.01|99999999999999999999.9999999999
+100|12.8788|string1|1922-04-02|2010-01-02 
02:05:06|TRUE|999.99|-99999999999999999999.9999999999
+5748|67.87|sample|1987-04-06|2010-01-02 
04:03:06|TRUE|-999.99|00000000000000000000.0000000001
+5748|67.87|Sample|1987-04-06|2010-01-02 
04:03:06|TRUE|181.18|-00000000000000000000.0000000001
+5748|67.87|sample|1987-04-06|2010-01-02 
04:03:06|TRUE|181.18|12345678901234567890.0123456789
+5748|67.87|sample|1987-04-06|2010-01-02 
04:03:06|TRUE|181.18|12345678901234567890.0123456789
+5000|67.87|testing|\N|2010-01-02 04:03:06|\N|\N|\N
+6000|\N|\N|1987-04-06|\N|TRUE|\N|\N
+\N|98.52|\N|\N|\N|TRUE|181.18|\N
diff --git a/regression-test/data/insert_p0/insert.out 
b/regression-test/data/insert_p0/insert.out
new file mode 100644
index 0000000000..1c2ac24944
--- /dev/null
+++ b/regression-test/data/insert_p0/insert.out
@@ -0,0 +1,204 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !insert --
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+1      98.8777 abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      \N      abc     2014-01-01      \N      false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      0.245   abc     2014-01-01      2005-01-09T04:05:06     false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      2002-01-07T01:05:06     false   123.22  
123456789012345678.012345678
+1      99.8777 abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      9.8777  abc     2014-01-01      2010-01-02T05:09:06     false   123.22  
123456789012345678.012345678
+1      12.8788 abc     2014-01-01      2010-01-02T02:05:06     false   123.22  
123456789012345678.012345678
+1      55.52   abc     2014-01-01      1989-01-08T04:05:06     false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      1999-01-08T02:05:06     false   123.22  
123456789012345678.012345678
+1      98.52   abc     2014-01-01      \N      false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.1     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+\N     \N      \N      \N      \N      \N      \N      \N
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+4      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+4      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+\N     113.52  \N      \N      \N      true    90.59   \N
+60     27.25   String1 1999-01-08      1999-01-08T02:05:06     true    61.61   0
+125    70.52000000000001       test    1952-01-05      1989-01-08T04:05:06     
false   160.61  0
+500    27.25   testing 1949-07-08      2002-01-07T01:05:06     true    -196.61 0
+500    114.8777        AGAIN   1987-04-09      2010-01-02T04:03:06     true    
0       0
+500    24.8777 STRING1 1923-04-08      2010-01-02T05:09:06     true    5.01    
2
+500    27.8788 string1 1922-04-02      2010-01-02T02:05:06     true    500     0
+4820   15.245  Again   1936-02-08      2005-01-09T04:05:06     false   166.91  0
+25000  82.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+26260  27.25   sample  1987-04-09      2010-01-02T04:03:06     true    61.5    
1
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    -500    0
+28740  82.87   Sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+30000  \N      \N      1987-04-06      \N      true    \N      \N
+44980  113.8777        again   1987-04-09      2010-01-02T04:03:06     false   
-0.01   0
+\N     98.52   \N      \N      \N      true    181.18  \N
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+25     55.52   test    1952-01-05      1989-01-08T04:05:06     false   321.21  
-123456789012345678.900123456
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+100    99.8777 AGAIN   1987-04-09      2010-01-02T04:03:06     true    0       0
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+5000   67.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    -999.99 0
+5748   67.87   Sample  1987-04-06      2010-01-02T04:03:06     true    181.18  0
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+6000   \N      \N      1987-04-06      \N      true    \N      \N
+8996   98.8777 again   1987-04-09      2010-01-02T04:03:06     false   -0.01   
999999999999999999.999999999
+\N     98.52   \N      \N      \N      true    181.18  \N
+\N     113.52  \N      \N      \N      true    90.59   \N
+\N     \N      \N      \N      \N      \N      \N      \N
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+1      2.1     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      2.2     abc     2014-01-01      2015-01-01T03:15:16     false   123.22  
123456789012345678.012345678
+1      98.52   abc     2014-01-01      \N      false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      1999-01-08T02:05:06     false   123.22  
123456789012345678.012345678
+1      55.52   abc     2014-01-01      1989-01-08T04:05:06     false   123.22  
123456789012345678.012345678
+1      12.8788 abc     2014-01-01      2010-01-02T02:05:06     false   123.22  
123456789012345678.012345678
+1      9.8777  abc     2014-01-01      2010-01-02T05:09:06     false   123.22  
123456789012345678.012345678
+1      99.8777 abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      2002-01-07T01:05:06     false   123.22  
123456789012345678.012345678
+1      0.245   abc     2014-01-01      2005-01-09T04:05:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      12.25   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      67.87   abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+1      \N      abc     2014-01-01      \N      false   123.22  
123456789012345678.012345678
+1      98.8777 abc     2014-01-01      2010-01-02T04:03:06     false   123.22  
123456789012345678.012345678
+4      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+4      1.1     a       2016-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+25     55.52   test    1952-01-05      1989-01-08T04:05:06     false   321.21  
-123456789012345678.900123456
+60     27.25   String1 1999-01-08      1999-01-08T02:05:06     true    61.61   0
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    99.8777 AGAIN   1987-04-09      2010-01-02T04:03:06     true    0       0
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+125    70.52000000000001       test    1952-01-05      1989-01-08T04:05:06     
false   160.61  0
+500    27.8788 string1 1922-04-02      2010-01-02T02:05:06     true    500     0
+500    24.8777 STRING1 1923-04-08      2010-01-02T05:09:06     true    5.01    
2
+500    114.8777        AGAIN   1987-04-09      2010-01-02T04:03:06     true    
0       0
+500    27.25   testing 1949-07-08      2002-01-07T01:05:06     true    -196.61 0
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+4820   15.245  Again   1936-02-08      2005-01-09T04:05:06     false   166.91  0
+5000   67.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   Sample  1987-04-06      2010-01-02T04:03:06     true    181.18  0
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    -999.99 0
+6000   \N      \N      1987-04-06      \N      true    \N      \N
+8996   98.8777 again   1987-04-09      2010-01-02T04:03:06     false   -0.01   
999999999999999999.999999999
+25000  82.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+26260  27.25   sample  1987-04-09      2010-01-02T04:03:06     true    61.5    
1
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+28740  82.87   Sample  1987-04-06      2010-01-02T04:03:06     true    90.59   0
+28740  82.87   sample  1987-04-06      2010-01-02T04:03:06     true    -500    0
+30000  \N      \N      1987-04-06      \N      true    \N      \N
+44980  113.8777        again   1987-04-09      2010-01-02T04:03:06     false   
-0.01   0
+\N     98.52   \N      \N      \N      true    181.18  \N
+\N     98.52   \N      \N      \N      true    181.18  \N
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+25     55.52   test    1952-01-05      1989-01-08T04:05:06     false   321.21  
-123456789012345678.900123456
+25     55.52   test    1952-01-05      1989-01-08T04:05:06     false   321.21  
-123456789012345678.900123456
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+100    99.8777 AGAIN   1987-04-09      2010-01-02T04:03:06     true    0       0
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+100    12.25   testing 1949-07-08      2002-01-07T01:05:06     true    -393.22 
-987654321098765432.109876543
+100    99.8777 AGAIN   1987-04-09      2010-01-02T04:03:06     true    0       0
+100    9.8777  STRING1 1923-04-08      2010-01-02T05:09:06     true    10.01   
2
+100    12.8788 string1 1922-04-02      2010-01-02T02:05:06     true    999.99  
-999999999999999999.999999999
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+964    0.245   Again   1936-02-08      2005-01-09T04:05:06     false   333.82  
987654321098765432.109876543
+5000   67.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+5000   67.87   testing \N      2010-01-02T04:03:06     \N      \N      \N
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+5252   12.25   sample  1987-04-09      2010-01-02T04:03:06     true    123     
1
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    -999.99 0
+5748   67.87   Sample  1987-04-06      2010-01-02T04:03:06     true    181.18  0
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    -999.99 0
+5748   67.87   Sample  1987-04-06      2010-01-02T04:03:06     true    181.18  0
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+5748   67.87   sample  1987-04-06      2010-01-02T04:03:06     true    181.18  
123456789012345678.900123456
+6000   \N      \N      1987-04-06      \N      true    \N      \N
+6000   \N      \N      1987-04-06      \N      true    \N      \N
+8996   98.8777 again   1987-04-09      2010-01-02T04:03:06     false   -0.01   
999999999999999999.999999999
+8996   98.8777 again   1987-04-09      2010-01-02T04:03:06     false   -0.01   
999999999999999999.999999999
+\N     98.52   \N      \N      \N      true    181.18  \N
+12     12.25   String1 1999-01-08      1999-01-08T02:05:06     true    123.22  
123456789012345678.900123456
+1      2.34567 a       2014-01-01      2015-01-01T03:15:16     true    123.22  
123456789012345678.012345678
+1      2.1     abc     2014-01-01      2015-01-01T03:15:16     false   -123.22 
-123456789012345678.012345678
+50     9.1     abc     2014-01-01      2015-01-01T03:15:16     true    123.22  
123456789012345678.012345678
+
diff --git a/regression-test/data/query_p0/limit/sql/predicateNotProjected.out 
b/regression-test/data/query_p0/limit/sql/predicateNotProjected.out
new file mode 100644
index 0000000000..455c11c4d7
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/predicateNotProjected.out
@@ -0,0 +1,6 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !predicateNotProjected --
+0
+1
+2
+
diff --git 
a/regression-test/data/query_p0/limit/sql/useRestrictiveLimitFromSubq.out 
b/regression-test/data/query_p0/limit/sql/useRestrictiveLimitFromSubq.out
new file mode 100644
index 0000000000..601966fdeb
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/useRestrictiveLimitFromSubq.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !useRestrictiveLimitFromSubq --
+2
+
diff --git a/regression-test/data/query_p0/limit/sql/withGroupBy.out 
b/regression-test/data/query_p0/limit/sql/withGroupBy.out
new file mode 100644
index 0000000000..b6d65a6224
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withGroupBy.out
@@ -0,0 +1,5 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withGroupBy --
+5      4
+5      3
+
diff --git 
a/regression-test/data/query_p0/limit/sql/withGroupByAndOrderByInSubq.out 
b/regression-test/data/query_p0/limit/sql/withGroupByAndOrderByInSubq.out
new file mode 100644
index 0000000000..6828203108
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withGroupByAndOrderByInSubq.out
@@ -0,0 +1,5 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withGroupByAndOrderByInSubq --
+5      0
+5      1
+
diff --git a/regression-test/data/query_p0/limit/sql/withGroupByInSubq.out 
b/regression-test/data/query_p0/limit/sql/withGroupByInSubq.out
new file mode 100644
index 0000000000..0554f517f4
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withGroupByInSubq.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withGroupByInSubq --
+20
+
diff --git a/regression-test/data/query_p0/limit/sql/withJoinInSubq.out 
b/regression-test/data/query_p0/limit/sql/withJoinInSubq.out
new file mode 100644
index 0000000000..9163b4364d
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withJoinInSubq.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withJoinInSubq --
+5
+
diff --git a/regression-test/data/query_p0/limit/sql/withLimitZero.out 
b/regression-test/data/query_p0/limit/sql/withLimitZero.out
new file mode 100644
index 0000000000..f2283c20af
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withLimitZero.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withLimitZero --
+0
+
diff --git a/regression-test/data/query_p0/limit/sql/withSimpleLimit.out 
b/regression-test/data/query_p0/limit/sql/withSimpleLimit.out
new file mode 100644
index 0000000000..1f02389b03
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withSimpleLimit.out
@@ -0,0 +1,8 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withSimpleLimit --
+24
+23
+22
+21
+20
+
diff --git a/regression-test/data/query_p0/limit/sql/withSubq.out 
b/regression-test/data/query_p0/limit/sql/withSubq.out
new file mode 100644
index 0000000000..c44b8c9919
--- /dev/null
+++ b/regression-test/data/query_p0/limit/sql/withSubq.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withSubq --
+10
+
diff --git 
a/regression-test/data/query_p0/select_no_from/sql/projectConstants.out 
b/regression-test/data/query_p0/select_no_from/sql/projectConstants.out
new file mode 100644
index 0000000000..d968f2aba0
--- /dev/null
+++ b/regression-test/data/query_p0/select_no_from/sql/projectConstants.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !projectConstants --
+1      1.1     510     a       dummy values    true    false
+
diff --git 
a/regression-test/data/query_p0/select_no_from/sql/projectFunctions.out 
b/regression-test/data/query_p0/select_no_from/sql/projectFunctions.out
new file mode 100644
index 0000000000..ceb4deaa2b
--- /dev/null
+++ b/regression-test/data/query_p0/select_no_from/sql/projectFunctions.out
@@ -0,0 +1,4 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !projectFunctions --
+10     2.0     false   true
+
diff --git a/regression-test/data/query_p0/select_no_from/sql/withUnionAll.out 
b/regression-test/data/query_p0/select_no_from/sql/withUnionAll.out
new file mode 100644
index 0000000000..36f7483aea
--- /dev/null
+++ b/regression-test/data/query_p0/select_no_from/sql/withUnionAll.out
@@ -0,0 +1,7 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !withUnionAll --
+1
+2
+20
+-5
+
diff --git 
a/regression-test/data/query_p0/set_operations/sql/except_1_order.out 
b/regression-test/data/query_p0/set_operations/sql/except_1_order.out
new file mode 100644
index 0000000000..843c0a26ff
--- /dev/null
+++ b/regression-test/data/query_p0/set_operations/sql/except_1_order.out
@@ -0,0 +1,6 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !except_1_order --
+CHINA
+PERU
+VIETNAM
+
diff --git 
a/regression-test/data/query_p0/set_operations/sql/except_2_order.out 
b/regression-test/data/query_p0/set_operations/sql/except_2_order.out
new file mode 100644
index 0000000000..74d09ad5a6
--- /dev/null
+++ b/regression-test/data/query_p0/set_operations/sql/except_2_order.out
@@ -0,0 +1,6 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !except_2_order --
+CHINA
+PERU
+VIETNAM
+
diff --git 
a/regression-test/data/query_p0/set_operations/sql/except_3_order.out 
b/regression-test/data/query_p0/set_operations/sql/except_3_order.out
new file mode 100644
index 0000000000..11c8ab0992
--- /dev/null
+++ b/regression-test/data/query_p0/set_operations/sql/except_3_order.out
@@ -0,0 +1,8 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !except_3_order --
+\N
+1
+10
+3
+6
+
diff --git 
a/regression-test/data/query_p0/set_operations/sql/intersect_1_order.out 
b/regression-test/data/query_p0/set_operations/sql/intersect_1_order.out
new file mode 100644
index 0000000000..5a9ca47840
--- /dev/null
+++ b/regression-test/data/query_p0/set_operations/sql/intersect_1_order.out
@@ -0,0 +1,9 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !intersect_1_order --
+CHINA
+INDIA
+INDONESIA
+JAPAN
+PERU
+VIETNAM
+
diff --git 
a/regression-test/data/query_p0/set_operations/sql/intersect_2_order.out 
b/regression-test/data/query_p0/set_operations/sql/intersect_2_order.out
new file mode 100644
index 0000000000..aebd8e8ae0
--- /dev/null
+++ b/regression-test/data/query_p0/set_operations/sql/intersect_2_order.out
@@ -0,0 +1,10 @@
+-- This file is automatically generated. You should know what you did if you 
want to edit this
+-- !intersect_2_order --
+\N
+2
+4
+5
+7
+8
+9
+
diff --git a/regression-test/suites/insert_p0/ddl/datatype.sql 
b/regression-test/suites/insert_p0/ddl/datatype.sql
new file mode 100644
index 0000000000..5dce895cd4
--- /dev/null
+++ b/regression-test/suites/insert_p0/ddl/datatype.sql
@@ -0,0 +1,15 @@
+CREATE TABLE `datatype` (
+    c_bigint bigint,
+    c_double double,
+    c_string string,
+    c_date date,
+    c_timestamp datetime,
+    c_boolean boolean,
+    c_short_decimal decimal(5,2),
+    c_long_decimal decimal(27,9)
+)
+DUPLICATE KEY(c_bigint)
+DISTRIBUTED BY HASH(c_bigint) BUCKETS 1
+PROPERTIES (
+  "replication_num" = "1"
+)
diff --git a/regression-test/suites/insert_p0/ddl/mutable_datatype.sql 
b/regression-test/suites/insert_p0/ddl/mutable_datatype.sql
new file mode 100644
index 0000000000..dc4d5d02f3
--- /dev/null
+++ b/regression-test/suites/insert_p0/ddl/mutable_datatype.sql
@@ -0,0 +1,15 @@
+CREATE TABLE `mutable_datatype` (
+    c_bigint bigint,
+    c_double double,
+    c_string string,
+    c_date date,
+    c_timestamp datetime,
+    c_boolean boolean,
+    c_short_decimal decimal(5,2),
+    c_long_decimal decimal(27,9)
+)
+DUPLICATE KEY(c_bigint)
+DISTRIBUTED BY HASH(c_bigint) BUCKETS 1
+PROPERTIES (
+  "replication_num" = "1"
+)
diff --git a/regression-test/suites/insert_p0/insert.groovy 
b/regression-test/suites/insert_p0/insert.groovy
new file mode 100644
index 0000000000..27688f7971
--- /dev/null
+++ b/regression-test/suites/insert_p0/insert.groovy
@@ -0,0 +1,85 @@
+
+// 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.
+
+// The cases is copied from https://github.com/trinodb/trino/tree/master
+// /testing/trino-product-tests/src/main/resources/sql-tests/testcases
+// and modified by Doris.
+suite("insert") {
+    def tables=["datatype", "mutable_datatype"]
+
+    for (String table in tables) {
+        sql """ DROP TABLE IF EXISTS $table """
+    }
+
+    for (String table in tables) {
+        sql new File("""${context.file.parent}/ddl/${table}.sql""").text
+    }
+
+    streamLoad {
+        // you can skip declare db, because a default db already specify in 
${DORIS_HOME}/conf/regression-conf.groovy
+        // db 'regression_test'
+        table 'datatype'
+
+        // default label is UUID:
+        // set 'label' UUID.randomUUID().toString()
+
+        // default column_separator is specify in doris fe config, usually is 
'\t'.
+        // this line change to ','
+        set 'column_separator', '|'
+
+        // relate to 
${DORIS_HOME}/regression-test/data/demo/streamload_input.csv.
+        // also, you can stream load a http stream, e.g. http://xxx/some.csv
+        file 'datetype.csv'
+
+        time 10000 // limit inflight 10s
+
+        // stream load action will check result, include Success status, and 
NumberTotalRows == NumberLoadedRows
+
+        // if declared a check callback, the default check condition will 
ignore.
+        // So you must check all condition
+        check { result, exception, startTime, endTime ->
+            if (exception != null) {
+                throw exception
+            }
+            log.info("Stream load result: ${result}".toString())
+            def json = parseJson(result)
+            assertEquals("success", json.Status.toLowerCase())
+            assertEquals(json.NumberTotalRows, json.NumberLoadedRows)
+            assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0)
+        }
+    }
+
+    sql """ insert into mutable_datatype select c_bigint, c_double, c_string, 
c_date, c_timestamp, c_boolean, c_short_decimal, c_long_decimal from datatype 
where c_double < 20 """
+    sql """ insert into mutable_datatype select 1, c_double, 'abc', 
cast('2014-01-01' as date), c_timestamp, FALSE, '123.22', 
'123456789012345678.012345678' from datatype """
+    sql """ insert into mutable_datatype select 1, cast(2.2 as double), 'abc', 
cast('2014-01-01' as date), cast('2015-01-01 03:15:16' as datetime), false, 
'123.22', '123456789012345678.012345678' from datatype """
+    sql """ insert into mutable_datatype select 1, cast(2.1 as double), 'abc', 
cast('2014-01-01' as date), cast('2015-01-01 03:15:16' as datetime), FALSE, 
'123.22', '123456789012345678.012345678' """
+    sql """ insert into mutable_datatype values (null, null, null, null, null, 
null, null, null) """
+    sql """ insert into mutable_datatype select count(*), cast(1.1 as double), 
'a', cast('2016-01-01' as date), cast('2015-01-01 03:15:16' as datetime), 
FALSE, '-123.22', '-123456789012345678.012345678' from datatype group by 
c_bigint """
+    sql """ insert into mutable_datatype select 5 * c_bigint, c_double + 15, 
c_string, c_date, c_timestamp, c_boolean, cast((c_short_decimal / '2.00') as 
decimal(5,2)), cast((c_long_decimal % '10') as decimal(27,9)) from datatype """
+    sql """ insert into mutable_datatype select * from datatype """
+    sql """ insert into mutable_datatype select * from mutable_datatype """
+    sql """ insert into mutable_datatype select * from datatype union all 
select * from datatype """
+    sql """ insert into mutable_datatype select * from datatype order by 1 
limit 2 """
+    sql """ insert into mutable_datatype select * from datatype where c_bigint 
< 0 """
+    sql """ insert into mutable_datatype values(1,cast(2.34567 as 
double),'a',cast('2014-01-01' as date), cast ('2015-01-01 03:15:16' as 
datetime), TRUE, '123.22', '123456789012345678.012345678') """
+    sql """ insert into mutable_datatype values(1, cast(2.1 as double), 'abc', 
cast('2014-01-01' as date), cast('2015-01-01 03:15:16' as datetime), FALSE, 
'-123.22', '-123456789012345678.012345678') """
+    sql """ insert into mutable_datatype values(5 * 10, cast(4.1 + 5 as 
double), 'abc', cast('2014-01-01' as date), cast('2015-01-01 03:15:16' as 
datetime), TRUE, '123.22', '123456789012345678.012345678') """
+
+    qt_insert """ select * from mutable_datatype """
+
+}
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/aggregate/aggregate.groovy 
b/regression-test/suites/query_p0/aggregate/aggregate.groovy
index 8053479c1c..0f5928cd62 100644
--- a/regression-test/suites/query_p0/aggregate/aggregate.groovy
+++ b/regression-test/suites/query_p0/aggregate/aggregate.groovy
@@ -79,6 +79,7 @@ suite("aggregate") {
         }
     }
 
+    sql " sync "
     qt_aggregate """ select max(upper(c_string)), min(upper(c_string)) from 
${tableName} """
     qt_aggregate """ select avg(c_bigint), avg(c_double) from ${tableName} """
     qt_aggregate """ select avg(distinct c_bigint), avg(distinct c_double) 
from ${tableName} """
diff --git a/regression-test/suites/query_p0/limit/ddl/lineitem.sql 
b/regression-test/suites/query_p0/limit/ddl/lineitem.sql
new file mode 100644
index 0000000000..530befceb1
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/lineitem.sql
@@ -0,0 +1,18 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_lineitem (
+       orderkey bigint,
+       partkey bigint,
+       suppkey bigint,
+       linenumber integer,
+       quantity double,
+       extendedprice double,
+       discount double,
+       tax double,
+       returnflag varchar(1),
+       linestatus varchar(1),
+       shipdate date,
+       commitdate date,
+       receiptdate date,
+       shipinstruct varchar(25),
+       shipmode varchar(10),
+       comment varchar(44)
+) DUPLICATE KEY(orderkey) DISTRIBUTED BY HASH(orderkey) BUCKETS 3 PROPERTIES 
("replication_num" = "1")
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/limit/ddl/nation.sql 
b/regression-test/suites/query_p0/limit/ddl/nation.sql
new file mode 100644
index 0000000000..074618815f
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/nation.sql
@@ -0,0 +1,12 @@
+
+CREATE TABLE IF NOT EXISTS tpch_tiny_nation (
+    nationkey  BIGINT NOT NULL,
+    name       VARCHAR(25) NOT NULL,
+    regionkey  BIGINT NOT NULL,
+    comment    VARCHAR(152)
+)
+DUPLICATE KEY(nationkey)
+DISTRIBUTED BY HASH(nationkey) BUCKETS 3
+PROPERTIES (
+    "replication_num" = "1"
+)
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/limit/ddl/part.sql 
b/regression-test/suites/query_p0/limit/ddl/part.sql
new file mode 100644
index 0000000000..f8d952c9e8
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/part.sql
@@ -0,0 +1,11 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_part (
+       p_partkey INTEGER NOT NULL,
+       p_name VARCHAR(55) NOT NULL,
+       p_mfgr CHAR(25) NOT NULL,
+       p_brand CHAR(10) NOT NULL,
+       p_type VARCHAR(25) NOT NULL,
+       p_size INTEGER NOT NULL,
+       p_container CHAR(10) NOT NULL,
+       p_retailprice DECIMAL(15, 2) NOT NULL,
+       p_comment VARCHAR(23) NOT NULL
+) DUPLICATE KEY(p_partkey) DISTRIBUTED BY HASH(p_partkey) BUCKETS 3 PROPERTIES 
("replication_num" = "1")
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/limit/ddl/partsupp.sql 
b/regression-test/suites/query_p0/limit/ddl/partsupp.sql
new file mode 100644
index 0000000000..43a0af0575
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/partsupp.sql
@@ -0,0 +1,7 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_partsupp (
+    partkey bigint,
+    suppkey bigint,
+    availqty integer,
+    supplycost double,
+    comment varchar(199)
+) DUPLICATE KEY(partkey, suppkey) DISTRIBUTED BY HASH(partkey) BUCKETS 3 
PROPERTIES ("replication_num" = "1")
diff --git a/regression-test/suites/query_p0/limit/ddl/region.sql 
b/regression-test/suites/query_p0/limit/ddl/region.sql
new file mode 100644
index 0000000000..36e282bb70
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/region.sql
@@ -0,0 +1,10 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_region (
+    r_regionkey  INTEGER NOT NULL,
+    r_name       CHAR(25) NOT NULL,
+    r_comment    VARCHAR(152)
+)
+DUPLICATE KEY(r_regionkey)
+DISTRIBUTED BY HASH(r_regionkey) BUCKETS 3
+PROPERTIES (
+    "replication_num" = "1"
+)
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/limit/ddl/supplier.sql 
b/regression-test/suites/query_p0/limit/ddl/supplier.sql
new file mode 100644
index 0000000000..ff594b41a1
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/supplier.sql
@@ -0,0 +1,9 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_supplier (
+       s_suppkey INTEGER NOT NULL,
+       s_name CHAR(25) NOT NULL,
+       s_address VARCHAR(40) NOT NULL,
+       s_nationkey INTEGER NOT NULL,
+       s_phone CHAR(15) NOT NULL,
+       s_acctbal DECIMAL(15, 2) NOT NULL,
+       s_comment VARCHAR(101) NOT NULL
+) DUPLICATE KEY(s_suppkey) DISTRIBUTED BY HASH(s_suppkey) BUCKETS 3 PROPERTIES 
("replication_num" = "1")
\ No newline at end of file
diff --git a/regression-test/suites/query_p0/limit/ddl/workers.sql 
b/regression-test/suites/query_p0/limit/ddl/workers.sql
new file mode 100644
index 0000000000..1ba2c331bc
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/ddl/workers.sql
@@ -0,0 +1,10 @@
+CREATE TABLE IF NOT EXISTS tpch_tiny_workers (
+  id_employee INT,
+  first_name VARCHAR(32),
+  last_name VARCHAR(32),
+  date_of_employment DATE,
+  department TINYINT(1),
+  id_department INT,
+  name VARCHAR(32),
+  salary INT
+) DUPLICATE KEY(id_employee) DISTRIBUTED BY HASH(first_name) BUCKETS 3 
PROPERTIES ("replication_num" = "1")
diff --git a/regression-test/suites/query_p0/limit/load.groovy 
b/regression-test/suites/query_p0/limit/load.groovy
new file mode 100644
index 0000000000..0ae7aaf347
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/load.groovy
@@ -0,0 +1,63 @@
+// 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.
+
+// The cases is copied from https://github.com/trinodb/trino/tree/master
+// 
/testing/trino-product-tests/src/main/resources/sql-tests/testcases/window_functions
+// and modified by Doris.
+
+suite("load") {
+    def tables = ['lineitem', 'region', 'nation', 'part', 'supplier', 
'partsupp', 'workers']
+
+    for (String table in tables) {
+        sql """ DROP TABLE IF EXISTS tpch_tiny_${table} """
+    }
+
+    for (String table in tables) {
+        sql new File("""${context.file.parent}/ddl/${table}.sql""").text
+    }
+
+    for (String tableName in tables) {
+        streamLoad {
+            // you can skip declare db, because a default db already specify 
in ${DORIS_HOME}/conf/regression-conf.groovy
+            // db 'regression_test'
+            table "tpch_tiny_${tableName}"
+
+            // default column_separator is specify in doris fe config, usually 
is '\t'.
+            // this line change to ','
+            set 'column_separator', '|'
+            set 'compress_type', 'GZ'
+            // relate to 
${DORIS_HOME}/regression-test/data/demo/streamload_input.csv.
+            // also, you can stream load a http stream, e.g. 
http://xxx/some.csv
+            file """${getS3Url() + '/regression/tpch/sf0.01/'+ 
tableName}.csv.gz"""
+
+            time 10000 // limit inflight 10s
+
+            // if declared a check callback, the default check condition will 
ignore.
+            // So you must check all condition
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals('success', json.Status.toLowerCase())
+                assertEquals(json.NumberTotalRows, json.NumberLoadedRows)
+                assertTrue(json.NumberLoadedRows > 0 && json.LoadBytes > 0)
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git 
a/regression-test/suites/query_p0/limit/sql/predicateNotProjected.sql 
b/regression-test/suites/query_p0/limit/sql/predicateNotProjected.sql
new file mode 100644
index 0000000000..c7affb8cd7
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/predicateNotProjected.sql
@@ -0,0 +1,3 @@
+-- database: presto; groups: limit; tables: nation
+SELECT nationkey FROM tpch_tiny_nation WHERE name < 'INDIA'
+ORDER BY nationkey LIMIT 3
diff --git 
a/regression-test/suites/query_p0/limit/sql/useRestrictiveLimitFromSubq.sql 
b/regression-test/suites/query_p0/limit/sql/useRestrictiveLimitFromSubq.sql
new file mode 100644
index 0000000000..c7a1a6659a
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/useRestrictiveLimitFromSubq.sql
@@ -0,0 +1,2 @@
+-- database: presto; groups: limit; tables: nation
+SELECT COUNT(*) FROM (SELECT * FROM tpch_tiny_nation LIMIT 2) AS foo LIMIT 5
diff --git a/regression-test/suites/query_p0/limit/sql/withGroupBy.sql 
b/regression-test/suites/query_p0/limit/sql/withGroupBy.sql
new file mode 100644
index 0000000000..e534c8a58d
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withGroupBy.sql
@@ -0,0 +1,4 @@
+-- database: presto; groups: limit; tables: nation
+SELECT COUNT(*), regionkey FROM tpch_tiny_nation GROUP BY regionkey
+ORDER BY regionkey DESC
+LIMIT 2
diff --git 
a/regression-test/suites/query_p0/limit/sql/withGroupByAndOrderByInSubq.sql 
b/regression-test/suites/query_p0/limit/sql/withGroupByAndOrderByInSubq.sql
new file mode 100644
index 0000000000..46aacc5633
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withGroupByAndOrderByInSubq.sql
@@ -0,0 +1,4 @@
+-- database: presto; groups: limit; tables: nation
+SELECT foo.c, foo.regionkey FROM
+    (SELECT regionkey, COUNT(*) AS c FROM tpch_tiny_nation
+    GROUP BY regionkey ORDER BY regionkey LIMIT 2) foo
diff --git a/regression-test/suites/query_p0/limit/sql/withGroupByInSubq.sql 
b/regression-test/suites/query_p0/limit/sql/withGroupByInSubq.sql
new file mode 100644
index 0000000000..dc01b0ca92
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withGroupByInSubq.sql
@@ -0,0 +1,4 @@
+-- database: presto; groups: limit; tables: partsupp
+SELECT COUNT(*) FROM (
+    SELECT suppkey, COUNT(*) FROM tpch_tiny_partsupp
+    GROUP BY suppkey LIMIT 20) t1
diff --git a/regression-test/suites/query_p0/limit/sql/withJoinInSubq.sql 
b/regression-test/suites/query_p0/limit/sql/withJoinInSubq.sql
new file mode 100644
index 0000000000..2abb6d48ef
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withJoinInSubq.sql
@@ -0,0 +1 @@
+SELECT COUNT(*) FROM (SELECT n1.regionkey, n1.nationkey FROM tpch_tiny_nation 
n1 JOIN tpch_tiny_nation n2 ON n1.regionkey = n2.regionkey LIMIT 5) foo
diff --git a/regression-test/suites/query_p0/limit/sql/withLimitZero.sql 
b/regression-test/suites/query_p0/limit/sql/withLimitZero.sql
new file mode 100644
index 0000000000..e23586184c
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withLimitZero.sql
@@ -0,0 +1,3 @@
+-- database: presto; groups: limit; tables: nation
+SELECT COUNT(*) FROM
+    (SELECT * FROM tpch_tiny_nation LIMIT 0) foo
diff --git a/regression-test/suites/query_p0/limit/sql/withSimpleLimit.sql 
b/regression-test/suites/query_p0/limit/sql/withSimpleLimit.sql
new file mode 100644
index 0000000000..5bc373a41d
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withSimpleLimit.sql
@@ -0,0 +1,2 @@
+-- database: presto; groups: limit; tables: nation
+SELECT nationkey from tpch_tiny_nation ORDER BY nationkey DESC LIMIT 5
diff --git a/regression-test/suites/query_p0/limit/sql/withSubq.sql 
b/regression-test/suites/query_p0/limit/sql/withSubq.sql
new file mode 100644
index 0000000000..ebb14262df
--- /dev/null
+++ b/regression-test/suites/query_p0/limit/sql/withSubq.sql
@@ -0,0 +1,2 @@
+-- database: presto; groups: limit; tables: nation
+SELECT COUNT(*) FROM (SELECT * FROM tpch_tiny_nation LIMIT 10) t1
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/projectAggFuncs.sql 
b/regression-test/suites/query_p0/select_no_from/sql/projectAggFuncs.sql
new file mode 100644
index 0000000000..50c3d56ed8
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/projectAggFuncs.sql
@@ -0,0 +1,4 @@
+/*
+-- database: presto; groups: no_from
+SELECT COUNT(10), MAX(50), MIN(90.0)
+*/
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/projectConstants.sql 
b/regression-test/suites/query_p0/select_no_from/sql/projectConstants.sql
new file mode 100644
index 0000000000..5ebcf40f4e
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/projectConstants.sql
@@ -0,0 +1,2 @@
+-- database: presto; groups: no_from
+SELECT 1, 1.1, 100*5.1, 'a', 'dummy values', TRUE, FALSE
\ No newline at end of file
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/projectFunctions.sql 
b/regression-test/suites/query_p0/select_no_from/sql/projectFunctions.sql
new file mode 100644
index 0000000000..866db8b1be
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/projectFunctions.sql
@@ -0,0 +1,2 @@
+-- database: presto; groups: no_from
+SELECT abs(-10.0E0), log2(4), TRUE AND FALSE, TRUE OR FALSE
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/withGroupOrderHaving.sql 
b/regression-test/suites/query_p0/select_no_from/sql/withGroupOrderHaving.sql
new file mode 100644
index 0000000000..679d822040
--- /dev/null
+++ 
b/regression-test/suites/query_p0/select_no_from/sql/withGroupOrderHaving.sql
@@ -0,0 +1,4 @@
+/*
+-- database: presto; groups: no_from
+SELECT MIN(10), 3 as col1 GROUP BY 2  HAVING 6 > 5 ORDER BY 1
+*/
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/withUnionAll.sql 
b/regression-test/suites/query_p0/select_no_from/sql/withUnionAll.sql
new file mode 100644
index 0000000000..bb11cda394
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/withUnionAll.sql
@@ -0,0 +1,8 @@
+-- database: presto; groups: no_from
+SELECT 1
+UNION ALL
+SELECT 2
+UNION ALL
+SELECT 4*5
+UNION ALL
+SELECT -5
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/withWhereClause.sql 
b/regression-test/suites/query_p0/select_no_from/sql/withWhereClause.sql
new file mode 100644
index 0000000000..3798fa8d56
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/withWhereClause.sql
@@ -0,0 +1,4 @@
+/*
+-- database: presto; groups: no_from
+SELECT 1 WHERE TRUE AND 2=2
+*/
diff --git 
a/regression-test/suites/query_p0/select_no_from/sql/withWhereFalse.sql 
b/regression-test/suites/query_p0/select_no_from/sql/withWhereFalse.sql
new file mode 100644
index 0000000000..c4096c2811
--- /dev/null
+++ b/regression-test/suites/query_p0/select_no_from/sql/withWhereFalse.sql
@@ -0,0 +1,4 @@
+/*
+-- database: presto; groups: no_from
+SELECT COUNT(*), 1 WHERE FALSE
+*/


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

Reply via email to