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 d88cc7debb0 Add more test cases on Doris SQL parser (#37640)
d88cc7debb0 is described below

commit d88cc7debb00840f71a3e19fd82d1b72091837b1
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jan 5 15:22:30 2026 +0800

    Add more test cases on Doris SQL parser (#37640)
---
 .../parser/src/main/resources/case/dml/presto.xml  | 70 ++++++++++++++++++++++
 .../main/resources/sql/supported/dml/presto.xml    |  3 +
 2 files changed, 73 insertions(+)

diff --git a/test/it/parser/src/main/resources/case/dml/presto.xml 
b/test/it/parser/src/main/resources/case/dml/presto.xml
index cf29ea9fbe3..1ff652f8953 100644
--- a/test/it/parser/src/main/resources/case/dml/presto.xml
+++ b/test/it/parser/src/main/resources/case/dml/presto.xml
@@ -1773,4 +1773,74 @@
         </values>
     </insert>
 
+    <select sql-case-id="presto_select_cast_lengths">
+        <projections start-index="7" stop-index="37">
+            <expression-projection text="CAST(order_id AS DECIMAL(10,2))" 
start-index="7" stop-index="37">
+                <expr>
+                    <function function-name="CAST" text="CAST(order_id AS 
DECIMAL(10,2))" start-index="7" stop-index="37">
+                        <parameter>
+                            <column name="order_id" start-index="12" 
stop-index="19" />
+                        </parameter>
+                        <parameter>
+                            <data-type value="DECIMAL" start-index="24" 
stop-index="36">
+                                <data-type-length precision="10" scale="2" 
start-index="32" stop-index="35" />
+                            </data-type>
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+        <from>
+            <simple-table name="t_order" start-index="44" stop-index="50" />
+        </from>
+    </select>
+
+    <select sql-case-id="presto_select_window_partition_only">
+        <from>
+            <simple-table name="t_order" start-index="34" stop-index="40" />
+        </from>
+        <projections start-index="7" stop-index="27">
+            <expression-projection text="ROW_NUMBER() OVER win" 
start-index="7" stop-index="27">
+                <expr>
+                    <function function-name="ROW_NUMBER" text="ROW_NUMBER() 
OVER win" start-index="7" stop-index="27" />
+                </expr>
+            </expression-projection>
+        </projections>
+        <window start-index="42" stop-index="76">
+            <window-item start-index="49" stop-index="76">
+                <window-name>win</window-name>
+                <partition-by>
+                    <expression-projection text="status" start-index="70" 
stop-index="75">
+                        <expr>
+                            <column name="status" start-index="70" 
stop-index="75" />
+                        </expr>
+                    </expression-projection>
+                </partition-by>
+            </window-item>
+        </window>
+    </select>
+
+    <delete sql-case-id="presto_delete_order_limit">
+        <table name="t_order" start-index="12" stop-index="18" />
+        <where start-index="20" stop-index="33">
+            <expr>
+                <binary-operation-expression start-index="26" stop-index="33">
+                    <left>
+                        <column name="flag" start-index="26" stop-index="29" />
+                    </left>
+                    <operator>=</operator>
+                    <right>
+                        <literal-expression value="1" start-index="33" 
stop-index="33" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+        </where>
+        <order-by>
+            <column-item name="order_id" start-index="44" stop-index="51" />
+        </order-by>
+        <limit start-index="53" stop-index="59">
+            <row-count value="1" start-index="59" stop-index="59" />
+        </limit>
+    </delete>
+
 </sql-parser-test-cases>
diff --git a/test/it/parser/src/main/resources/sql/supported/dml/presto.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/presto.xml
index da819eed0ec..745ca2f2876 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/presto.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/presto.xml
@@ -88,4 +88,7 @@
     <sql-case id="presto_select_udf_with_param" value="SELECT my_udf(order_id) 
FROM t_order" db-types="Presto" />
     <sql-case id="presto_insert_select_no_columns" value="INSERT INTO t_order 
SELECT 1" db-types="Presto" />
     <sql-case id="presto_insert_values_empty_columns" value="INSERT INTO 
t_order () VALUES (1)" db-types="Presto" />
+    <sql-case id="presto_select_cast_lengths" value="SELECT CAST(order_id AS 
DECIMAL(10,2)) FROM t_order" db-types="Presto" />
+    <sql-case id="presto_select_window_partition_only" value="SELECT 
ROW_NUMBER() OVER win FROM t_order WINDOW win AS (PARTITION BY status)" 
db-types="Presto" />
+    <sql-case id="presto_delete_order_limit" value="DELETE FROM t_order WHERE 
flag = 1 ORDER BY order_id LIMIT 1" db-types="Presto" />
 </sql-cases>

Reply via email to