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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5d3196d0b2f Add more test cases on Doris SQL parser (#37656)
5d3196d0b2f is described below

commit 5d3196d0b2fd9d6bf8585b6f10981a09fc717f49
Author: Liang Zhang <[email protected]>
AuthorDate: Tue Jan 6 15:49:20 2026 +0800

    Add more test cases on Doris SQL parser (#37656)
    
    * Add more test cases on Doris SQL parser
    
    * Add more test cases on Doris SQL parser
    
    * Add more test cases on Doris SQL parser
    
    * Add more test cases on Doris SQL parser
    
    * Add more test cases on Doris SQL parser
    
    * Add more test cases on Doris SQL parser
---
 .../main/resources/case/dml/select-expression.xml  |  2 +-
 .../main/resources/case/dml/select-pagination.xml  | 13 +++++++++
 .../resources/case/dml/select-special-function.xml | 17 ++++++++++++
 .../src/main/resources/case/dml/select-window.xml  | 31 ++++++++++++++++++++++
 .../parser/src/main/resources/case/dml/select.xml  | 30 +++++++++++++++++++++
 .../resources/sql/supported/dml/select-combine.xml | 10 +++----
 .../resources/sql/supported/dml/select-join.xml    |  4 +--
 .../sql/supported/dml/select-pagination.xml        |  1 +
 .../sql/supported/dml/select-special-function.xml  |  5 ++--
 .../sql/supported/dml/select-sub-query.xml         |  6 ++---
 .../resources/sql/supported/dml/select-window.xml  |  2 ++
 .../main/resources/sql/supported/dml/select.xml    |  5 +++-
 12 files changed, 112 insertions(+), 14 deletions(-)

diff --git a/test/it/parser/src/main/resources/case/dml/select-expression.xml 
b/test/it/parser/src/main/resources/case/dml/select-expression.xml
index f40c12b919a..a46a75008af 100644
--- a/test/it/parser/src/main/resources/case/dml/select-expression.xml
+++ b/test/it/parser/src/main/resources/case/dml/select-expression.xml
@@ -2647,7 +2647,7 @@
             </expr>
         </where>
     </select>
-
+    
     <select sql-case-id="select_age_for_postgres">
         <projections start-index="7" stop-index="7">
             <shorthand-projection start-index="7" stop-index="7" />
diff --git a/test/it/parser/src/main/resources/case/dml/select-pagination.xml 
b/test/it/parser/src/main/resources/case/dml/select-pagination.xml
index 12df53c371b..6dd946bb74d 100644
--- a/test/it/parser/src/main/resources/case/dml/select-pagination.xml
+++ b/test/it/parser/src/main/resources/case/dml/select-pagination.xml
@@ -2084,6 +2084,19 @@
         </from>
     </select>
 
+    <select sql-case-id="select_limit_offset_doris">
+        <from>
+            <simple-table name="t_order" start-index="14" stop-index="20" />
+        </from>
+        <projections start-index="7" stop-index="7">
+            <shorthand-projection start-index="7" stop-index="7" />
+        </projections>
+        <limit start-index="22" stop-index="37">
+            <row-count value="5" start-index="28" stop-index="28" />
+            <offset value="2" start-index="37" stop-index="37" />
+        </limit>
+    </select>
+
 <!--        <select 
sql-case-id="select_pagination_with_first_and_expr_value">-->
 <!--            <limit start-index="7" stop-index="17">-->
 <!--                <row-count value="1" start-index="13" stop-index="17"/>-->
diff --git 
a/test/it/parser/src/main/resources/case/dml/select-special-function.xml 
b/test/it/parser/src/main/resources/case/dml/select-special-function.xml
index 8291c760b5c..4efb09019b6 100644
--- a/test/it/parser/src/main/resources/case/dml/select-special-function.xml
+++ b/test/it/parser/src/main/resources/case/dml/select-special-function.xml
@@ -166,6 +166,23 @@
             <simple-table name="customer" start-index="126" stop-index="133" />
         </from>
     </select>
+
+    <select sql-case-id="select_timestampdiff_doris">
+        <projections start-index="7" stop-index="50">
+            <expression-projection 
text="TIMESTAMPDIFF(DAY,'2020-01-01','2020-01-03')" start-index="7" 
stop-index="50">
+                <expr>
+                    <function function-name="TIMESTAMPDIFF" start-index="7" 
stop-index="50" text="TIMESTAMPDIFF(DAY,'2020-01-01','2020-01-03')">
+                        <parameter>
+                            <literal-expression value="2020-01-01" 
start-index="25" stop-index="36" />
+                        </parameter>
+                        <parameter>
+                            <literal-expression value="2020-01-03" 
start-index="38" stop-index="49" />
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
     <select sql-case-id="select_convert_function">
         <projections start-index="7" stop-index="33">
             <expression-projection text="CONVERT('2020-10-01', DATE)" 
start-index="7" stop-index="33">
diff --git a/test/it/parser/src/main/resources/case/dml/select-window.xml 
b/test/it/parser/src/main/resources/case/dml/select-window.xml
index 4ac06b0c561..fe72a2869d5 100644
--- a/test/it/parser/src/main/resources/case/dml/select-window.xml
+++ b/test/it/parser/src/main/resources/case/dml/select-window.xml
@@ -61,4 +61,35 @@
             </window-item>
         </window>
     </select>
+
+    <select sql-case-id="select_window_partition_order_doris">
+        <projections start-index="7" stop-index="51">
+            <expression-projection text="ROW_NUMBER() OVER (PARTITION BY k 
ORDER BY v)" start-index="7" stop-index="51">
+                <expr>
+                    <function function-name="ROW_NUMBER" start-index="7" 
stop-index="51" text="ROW_NUMBER() OVER (PARTITION BY k ORDER BY v)">
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+        <from>
+            <simple-table name="t_order" start-index="58" stop-index="64" />
+        </from>
+    </select>
+
+    <select sql-case-id="select_window_lead_lag_doris">
+        <projections start-index="7" stop-index="46">
+            <expression-projection text="LEAD(v) OVER (PARTITION BY k ORDER BY 
v)" start-index="7" stop-index="46">
+                <expr>
+                    <function function-name="LEAD" text="LEAD(v) OVER 
(PARTITION BY k ORDER BY v)" start-index="7" stop-index="46">
+                        <parameter>
+                            <column name="v" start-index="12" stop-index="12" 
/>
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+        <from>
+            <simple-table name="t_order" start-index="53" stop-index="59" />
+        </from>
+    </select>
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/case/dml/select.xml 
b/test/it/parser/src/main/resources/case/dml/select.xml
index 97e12ebaa3c..752a7c932c5 100644
--- a/test/it/parser/src/main/resources/case/dml/select.xml
+++ b/test/it/parser/src/main/resources/case/dml/select.xml
@@ -11802,4 +11802,34 @@
             <simple-table alias="T_ORDER" name="T_ORDER" start-index="20" 
stop-index="68"/>
         </from>
     </select>
+
+    <select sql-case-id="select_date_literal_doris">
+        <projections start-index="7" stop-index="23">
+            <expression-projection text="DATE'2020-01-01'" start-index="7" 
stop-index="23">
+                <expr>
+                    <common-expression text="DATE'2020-01-01'" start-index="7" 
stop-index="23" />
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_hex_literal_doris">
+        <projections start-index="7" stop-index="11">
+            <expression-projection text="0x1AF" start-index="7" 
stop-index="11">
+                <expr>
+                    <common-expression text="0x1AF" start-index="7" 
stop-index="11" />
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_bit_literal_doris">
+        <projections start-index="7" stop-index="13">
+            <expression-projection text="b'1010'" start-index="7" 
stop-index="13">
+                <expr>
+                    <common-expression text="b'1010'" start-index="7" 
stop-index="13" />
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
 </sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-combine.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-combine.xml
index 4393508089c..794ed652ac7 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-combine.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-combine.xml
@@ -18,8 +18,8 @@
 
 <sql-cases>
     <sql-case id="select_with_except" value="(SELECT * FROM t1) EXCEPT (SELECT 
* FROM t2)" db-types="MySQL,Doris" />
-    <sql-case id="select_union" value="SELECT * FROM table1 UNION SELECT * 
FROM table2" db-types="MySQL,PostgreSQL,openGauss" />
-    <sql-case id="select_union_all" value="SELECT * FROM table1 UNION ALL 
SELECT * FROM table2" db-types="MySQL,PostgreSQL,openGauss" />
+    <sql-case id="select_union" value="SELECT * FROM table1 UNION SELECT * 
FROM table2" db-types="MySQL,PostgreSQL,openGauss,Doris" />
+    <sql-case id="select_union_all" value="SELECT * FROM table1 UNION ALL 
SELECT * FROM table2" db-types="MySQL,PostgreSQL,openGauss,Doris" />
     <sql-case id="select_union_all_order_by" value="SELECT * FROM table1 UNION 
ALL SELECT * FROM table2 ORDER BY id" db-types="MySQL,PostgreSQL,openGauss" />
     <sql-case id="select_union_all_order_by_limit" value="SELECT * FROM table1 
UNION ALL SELECT * FROM table2 ORDER BY id LIMIT 1, 1" 
db-types="MySQL,openGauss" />
     <sql-case id="select_intersect" value="SELECT * FROM table1 INTERSECT 
SELECT * FROM table2 INTERSECT SELECT * FROM table3" 
db-types="MySQL,PostgreSQL,openGauss" />
@@ -31,9 +31,9 @@
     <sql-case id="select_minus" value="SELECT * FROM table1 MINUS SELECT * 
FROM table2" db-types="openGauss" />
     <sql-case id="select_minus_order_by" value="SELECT * FROM table1 MINUS 
SELECT * FROM table2 ORDER BY id" db-types="openGauss" />
     <sql-case id="select_minus_order_by_limit" value="SELECT * FROM table1 
MINUS SELECT * FROM table2 ORDER BY id LIMIT 1, 1" db-types="openGauss" />
-    <sql-case id="select_union_intersect" value="SELECT * FROM table1 UNION 
SELECT * FROM table2 INTERSECT SELECT * FROM table3" 
db-types="PostgreSQL,openGauss" />
-    <sql-case id="select_union_except" value="SELECT * FROM table1 UNION 
SELECT * FROM table2 EXCEPT SELECT * FROM table3" 
db-types="PostgreSQL,openGauss" />
-    <sql-case id="select_union_intersect_except" value="SELECT * FROM table1 
UNION SELECT * FROM table2 INTERSECT SELECT * FROM table3 EXCEPT SELECT * FROM 
table4" db-types="PostgreSQL,openGauss" />
+    <sql-case id="select_union_intersect" value="SELECT * FROM table1 UNION 
SELECT * FROM table2 INTERSECT SELECT * FROM table3" 
db-types="PostgreSQL,openGauss,Doris" />
+    <sql-case id="select_union_except" value="SELECT * FROM table1 UNION 
SELECT * FROM table2 EXCEPT SELECT * FROM table3" 
db-types="PostgreSQL,openGauss,Doris" />
+    <sql-case id="select_union_intersect_except" value="SELECT * FROM table1 
UNION SELECT * FROM table2 INTERSECT SELECT * FROM table3 EXCEPT SELECT * FROM 
table4" db-types="PostgreSQL,openGauss,Doris" />
     <sql-case id="select_except_union" value="SELECT * FROM table1 EXCEPT 
SELECT * FROM table2 UNION SELECT * FROM table3" 
db-types="PostgreSQL,openGauss" />
     <sql-case id="select_except_intersect" value="SELECT * FROM table1 EXCEPT 
SELECT * FROM table2 INTERSECT SELECT * FROM table3" 
db-types="PostgreSQL,openGauss" />
     <sql-case id="select_except_intersect_union" value="SELECT * FROM table1 
EXCEPT SELECT * FROM table2 INTERSECT SELECT * FROM table3 UNION SELECT * FROM 
table4" db-types="MySQL,PostgreSQL,openGauss" />
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-join.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-join.xml
index 309979f0fdf..8ab5007033d 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-join.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-join.xml
@@ -19,13 +19,13 @@
 <sql-cases>
     <sql-case id="select_inner_join_related_with_alias" value="SELECT i.* FROM 
t_order o INNER JOIN t_order_item i ON o.order_id = i.order_id WHERE o.order_id 
= ?" />
     <sql-case id="select_inner_join_related_with_name" value="SELECT 
t_order_item.* FROM t_order JOIN t_order_item ON t_order.order_id = 
t_order_item.order_id WHERE t_order.order_id = ?" />
-    <sql-case id="select_join_using" value="SELECT i.* FROM t_order o JOIN 
t_order_item i USING(order_id) WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss" />
+    <sql-case id="select_join_using" value="SELECT i.* FROM t_order o JOIN 
t_order_item i USING(order_id) WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Doris" />
     <sql-case id="select_left_outer_join_related_with_alias" value="SELECT 
d.department_id, e.last_name FROM departments d LEFT OUTER JOIN employees e ON 
d.department_id = e.department_id ORDER BY d.department_id, e.last_name" 
db-types="MySQL, Oracle" />
     <sql-case id="select_right_outer_join_related_with_alias" value="SELECT 
d.department_id, e.last_name FROM departments d RIGHT OUTER JOIN employees e ON 
d.department_id = e.department_id ORDER BY d.department_id, e.last_name" 
db-types="MySQL, Oracle" />
     <sql-case id="select_full_outer_join_related_with_alias" value="SELECT 
d.department_id AS d_dept_id, e.department_id AS e_dept_id, e.last_name FROM 
departments d FULL OUTER JOIN employees e ON d.department_id = e.department_id 
ORDER BY d.department_id, e.last_name" db-types="Oracle" />
     <sql-case id="select_full_outer_join_using_related_with_alias" 
value="SELECT department_id AS d_e_dept_id, e.last_name FROM departments d FULL 
OUTER JOIN employees e USING (department_id) ORDER BY department_id, 
e.last_name" db-types="Oracle" />
     <sql-case id="select_cross_apply_join_related_with_alias" value="SELECT 
d.department_name, v.employee_id, v.last_name FROM departments d CROSS APPLY 
(SELECT * FROM employees e WHERE e.department_id = d.department_id) v WHERE 
d.department_name IN ('Marketing', 'Operations', 'Public Relations') ORDER BY 
d.department_name, v.employee_id" db-types="Oracle" />
-    <sql-case id="select_natural_join" value="SELECT * FROM t_order o NATURAL 
JOIN t_order_item i WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Oracle" />
+    <sql-case id="select_natural_join" value="SELECT * FROM t_order o NATURAL 
JOIN t_order_item i WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Oracle,Doris" />
     <sql-case id="select_natural_inner_join" value="SELECT * FROM t_order o 
NATURAL INNER JOIN t_order_item i WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Oracle" />
     <sql-case id="select_natural_left_join" value="SELECT * FROM t_order o 
NATURAL LEFT JOIN t_order_item i WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Oracle" />
     <sql-case id="select_natural_right_join" value="SELECT * FROM t_order o 
NATURAL RIGHT JOIN t_order_item i WHERE o.order_id = ?" 
db-types="MySQL,PostgreSQL,openGauss,Oracle" />
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-pagination.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-pagination.xml
index 1cf1fa6b4dc..617c4d523bd 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-pagination.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-pagination.xml
@@ -41,6 +41,7 @@
     <sql-case id="select_pagination_with_first" value="SELECT FIRST 1 1 a FROM 
t_order" db-types="Firebird" />
     <sql-case id="select_pagination_with_first_skip" value="SELECT FIRST 1 
SKIP 1 1 a FROM t_order" db-types="Firebird" />
     <sql-case id="select_pagination_with_skip" value="SELECT SKIP 1 1 a FROM 
t_order" db-types="Firebird" />
+    <sql-case id="select_limit_offset_doris" value="SELECT * FROM t_order 
LIMIT 5 OFFSET 2" db-types="Doris" />
 <!--    <sql-case id="select_pagination_with_first_and_expr_value" 
value="SELECT FIRST (1+1) 1 a FROM t_order" db-types="Firebird" />-->
 <!--    <sql-case id="select_pagination_with_skip_and_expr_value" 
value="SELECT SKIP (2+2) 1 a FROM t_order" db-types="Firebird" />-->
 </sql-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
 
b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
index e51645c5ad8..a3850ba7499 100644
--- 
a/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
+++ 
b/test/it/parser/src/main/resources/sql/supported/dml/select-special-function.xml
@@ -40,7 +40,7 @@
     <sql-case id="select_with_trim_expr_from_expr_and_both" value="SELECT 
TRIM(BOTH `remove_name` FROM `name`) FROM `t_order`" db-types="MySQL" />
     <sql-case id="select_weight_string" value="SELECT WEIGHT_STRING('bar')" 
db-types="MySQL" />
     <sql-case id="select_values" value="SELECT VALUES(order_id) FROM t_order" 
db-types="MySQL,Presto" />
-    <sql-case id="select_current_user_brackets" value="SELECT CURRENT_USER()" 
db-types="MySQL" />
+    <sql-case id="select_current_user_brackets" value="SELECT CURRENT_USER()" 
db-types="MySQL,Doris" />
     <sql-case id="select_extract_function" value="SELECT EXTRACT(YEAR FROM 
TIMESTAMP '2001-02-16 20:38:40')" db-types="PostgreSQL,openGauss" />
     <sql-case id="select_extract_function_week" value="SELECT EXTRACT(WEEK 
FROM TIMESTAMP '2001-02-16 20:38:40')" db-types="PostgreSQL,openGauss" />
     <sql-case id="select_extract_function_quarter" value="SELECT 
EXTRACT(QUARTER FROM TIMESTAMP '2001-02-16 20:38:40')" 
db-types="PostgreSQL,openGauss" />
@@ -102,7 +102,7 @@
     <sql-case id="select_with_week_function" value="SELECT 
WEEK('2018-02-20',1);" db-types="MySQL"/>
     <sql-case id="select_with_weekday_function" value="SELECT 
WEEKDAY('2017-02-03 22:23:00');" db-types="MySQL"/>
     <sql-case id="select_with_weekofyear_function" value="SELECT 
WEEKOFYEAR('2019-02-20');" db-types="MySQL"/>
-    <sql-case id="select_with_xor_function" value="SELECT 1 XOR NULL;" 
db-types="MySQL"/>
+    <sql-case id="select_with_xor_function" value="SELECT 1 XOR NULL;" 
db-types="MySQL,Doris"/>
     <sql-case id="select_with_year_function" value="SELECT 
YEAR('1999-09-09');" db-types="MySQL"/>
     <sql-case id="select_with_yearweek_function" value="SELECT 
YEARWEEK('1988-08-08');" db-types="MySQL"/>
     <sql-case id="select_with_weight_string_function" value="SELECT 
HEX(WEIGHT_STRING('MySQL'));" db-types="MySQL"/>
@@ -219,6 +219,7 @@
     <sql-case id="select_mod" value="SELECT MOD(234, 10)" 
db-types="MySQL,Doris" />
     <sql-case id="select_month" value="SELECT MONTH('2008-02-03')" 
db-types="MySQL,Doris" />
     <sql-case id="select_monthname" value="SELECT MONTHNAME('2008-02-03')" 
db-types="MySQL,Doris" />
+    <sql-case id="select_timestampdiff_doris" value="SELECT 
TIMESTAMPDIFF(DAY,'2020-01-01','2020-01-03')" db-types="Doris" />
     <sql-case id="select_multilinestring" value="SELECT 
MultiLineString(ST_GeomFromText('LineString(1 1, 2 
2)'),ST_GeomFromText('LineString(1 1, 2 2)'))" db-types="MySQL" />
     <sql-case id="select_multipoint" value="SELECT 
MultiPoint(point(1,1),point(1,1))" db-types="MySQL" />
     <sql-case id="select_multipolygon" value="SELECT 
MultiPolygon(ST_GeomFromText('Polygon((0 0, 1 0, 1 1, 0 1, 0 
0))'),ST_GeomFromText('Polygon((0 0, 1 0, 1 1, 0 1, 0 0))'))" db-types="MySQL" 
/>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-sub-query.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-sub-query.xml
index 23d1c6d3625..82e1a5c448f 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-sub-query.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-sub-query.xml
@@ -22,15 +22,15 @@
     <sql-case id="select_sub_query_with_table" value="SELECT t.* FROM (SELECT 
* FROM t_order WHERE order_id IN (?, ?)) t" />
     <sql-case id="select_with_equal_subquery" value="SELECT * FROM t_order 
WHERE user_id = (SELECT user_id FROM t_order_item WHERE id = 10)" 
db-types="MySQL, PostgreSQL,openGauss" />
     <sql-case id="select_with_any_subquery" value="SELECT * FROM employees 
WHERE salary = ANY (SELECT salary FROM employees WHERE department_id = 30) 
ORDER BY employee_id;" db-types="Oracle" />
-    <sql-case id="select_with_in_subquery" value="SELECT * FROM t_order WHERE 
user_id IN (SELECT user_id FROM t_order_item WHERE id IN (10, 11))" 
db-types="MySQL, PostgreSQL,openGauss" />
+    <sql-case id="select_with_in_subquery" value="SELECT * FROM t_order WHERE 
user_id IN (SELECT user_id FROM t_order_item WHERE id IN (10, 11))" 
db-types="MySQL,PostgreSQL,openGauss" />
     <sql-case id="select_with_between_subquery" value="SELECT * FROM t_order 
WHERE user_id BETWEEN (SELECT user_id FROM t_order_item WHERE order_id = 10) 
AND ?" db-types="MySQL, PostgreSQL,openGauss" />
-    <sql-case id="select_with_exists_sub_query_with_project" value="SELECT 
EXISTS (SELECT 1 FROM t_order)" db-types="MySQL, PostgreSQL,openGauss" />
+    <sql-case id="select_with_exists_sub_query_with_project" value="SELECT 
EXISTS (SELECT 1 FROM t_order)" db-types="MySQL,PostgreSQL,openGauss" />
     <sql-case id="select_with_join_table_subquery" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id, u.user_id FROM 
t_order_federate, (SELECT * FROM t_user_info) as u WHERE 
t_order_federate.user_id = u.user_id" db-types="MySQL, PostgreSQL,openGauss, 
SQLServer, SQL92" />
     <sql-case id="select_with_projection_subquery" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id, (SELECT COUNT(user_id) 
FROM t_user_info) FROM t_order_federate" />
     <sql-case id="select_with_projection_subquery_and_multiple_parameters" 
value="SELECT t_order_federate.order_id, t_order_federate.user_id, (SELECT 
CONCAT(order_id, user_id) FROM t_user_info) FROM t_order_federate" />
     <sql-case id="select_with_in_subquery_condition" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id FROM t_order_federate WHERE 
user_id IN (SELECT * FROM t_user_info)" />
     <sql-case id="select_with_between_and_subquery_condition" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id FROM t_order_federate WHERE 
user_id BETWEEN (SELECT user_id FROM t_user_info WHERE information = 'before') 
AND (SELECT user_id FROM t_user_info WHERE information = 'after')" />
-    <sql-case id="select_with_exist_subquery_condition" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id FROM t_order_federate WHERE 
EXISTS (SELECT * FROM t_user_info WHERE t_order_federate.user_id = 
t_user_info.user_id)" db-types="MySQL, PostgreSQL,openGauss" />
+    <sql-case id="select_with_exist_subquery_condition" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id FROM t_order_federate WHERE 
EXISTS (SELECT * FROM t_user_info WHERE t_order_federate.user_id = 
t_user_info.user_id)" db-types="MySQL,PostgreSQL,openGauss" />
     <sql-case id="select_with_not_exist_subquery_condition" value="SELECT 
t_order_federate.order_id, t_order_federate.user_id FROM t_order_federate WHERE 
NOT EXISTS (SELECT * FROM t_user_info WHERE t_order_federate.user_id = 
t_user_info.user_id)" db-types="MySQL" />
     <sql-case id="select_with_exist_string_split_subquery" value="SELECT 
ProductId, Name, Tags FROM Product WHERE EXISTS (SELECT * FROM 
STRING_SPLIT(Tags, ',') WHERE value IN ('clothing', 'road'))" 
db-types="SQLServer"/>
     <sql-case id="select_sub_query_with_cast_function" value="SELECT 
[T1_1].[BusinessEntityID] AS [BusinessEntityID], [T1_1].[rowguid] AS [rowguid], 
[T1_1].[ModifiedDate] AS [ModifiedDate] FROM  (SELECT [T2_1].[BusinessEntityID] 
AS [BusinessEntityID], [T2_1].[rowguid] AS [rowguid], [T2_1].[ModifiedDate] AS 
[ModifiedDate] FROM [AdventureWorks2022].[Person].[BusinessEntity] AS T2_1 
WHERE ([T2_1].[BusinessEntityID] = CAST ((17907) AS INT))) AS T1_1" 
db-types="SQLServer"/>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-window.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-window.xml
index eb9f286c0b2..701b75fa9e3 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-window.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-window.xml
@@ -18,4 +18,6 @@
 
 <sql-cases>
     <sql-case id="select_window" value="SELECT user_id, ROW_NUMBER() OVER w AS 
'row_number', RANK() OVER w AS 'rank', DENSE_RANK() OVER w AS 'dense_rank' FROM 
t_order WHERE order_id = ? WINDOW w AS (ORDER BY user_id)" 
db-types="MySQL,Doris" />
+    <sql-case id="select_window_partition_order_doris" value="SELECT 
ROW_NUMBER() OVER (PARTITION BY k ORDER BY v) FROM t_order" db-types="Doris" />
+    <sql-case id="select_window_lead_lag_doris" value="SELECT LEAD(v) OVER 
(PARTITION BY k ORDER BY v) FROM t_order" db-types="Doris" />
 </sql-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/select.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
index 8a68efa414b..6dda260f00c 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select.xml
@@ -229,7 +229,10 @@
     <sql-case id="select_with_last_value_function" value="SELECT 
LAST_VALUE(AGE IGNORE NULLS) OVER (PARTITION BY AGE ORDER BY AGE) from TEST;" 
db-types="Oracle" />
     <sql-case id="select_with_lead_and_lag_function" value="SELECT hire_date, 
LAG(hire_date, 1) OVER (ORDER BY hire_date) AS LAG1, LEAD(hire_date, 1) OVER 
(ORDER BY hire_date) AS LEAD1 FROM employees WHERE department_id = 30 ORDER BY 
hire_date;" db-types="Oracle,MySQL" />
     <sql-case id="select_with_connect_by_root" value="SELECT CONNECT_BY_ROOT 
last_name 'Manager' FROM employees CONNECT BY PRIOR employee_id = manager_id" 
db-types="Oracle" />
-    <sql-case id="select_with_ntile_function" value="SELECT NTILE(4) OVER 
(ORDER BY salary DESC) AS quartile FROM employees WHERE department_id = 100 
ORDER BY last_name" db-types="Oracle,MySQL" />
+    <sql-case id="select_with_ntile_function" value="SELECT NTILE(4) OVER 
(ORDER BY salary DESC) AS quartile FROM employees WHERE department_id = 100 
ORDER BY last_name" db-types="Oracle,MySQL,Doris" />
+    <sql-case id="select_date_literal_doris" value="SELECT DATE '2020-01-01'" 
db-types="Doris" />
+    <sql-case id="select_hex_literal_doris" value="SELECT 0x1AF" 
db-types="Doris" />
+    <sql-case id="select_bit_literal_doris" value="SELECT b'1010'" 
db-types="Doris" />
     <sql-case id="select_with_percentile_functions" value="SELECT 
department_id, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY salary DESC) 'Median 
cont', PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY salary DESC) 'Median disc' 
FROM employees GROUP BY department_id" db-types="Oracle" />
     <sql-case id="select_with_keep_clause" value="SELECT salary,MIN(salary) 
KEEP (DENSE_RANK FIRST ORDER BY commission_pct) OVER (PARTITION BY 
department_id) 'Worst', MAX(salary) KEEP (DENSE_RANK LAST ORDER BY 
commission_pct) OVER (PARTITION BY department_id) 'Best' FROM employees ORDER 
BY department_id" db-types="Oracle" />
     <sql-case id="select_with_corr_function" value="SELECT employee_id, 
CORR(SYSDATE - hire_date, salary) FROM employees WHERE department_id in (50, 
80) ORDER BY employee_id" db-types="Oracle" />

Reply via email to