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 18a1658bf4e Add more test cases on Presto SQL parser (#37650)
18a1658bf4e is described below

commit 18a1658bf4e8997e7e466de7fb08480c2bec9bc7
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jan 5 21:10:33 2026 +0800

    Add more test cases on Presto SQL parser (#37650)
---
 .../parser/src/main/resources/case/dml/presto.xml  | 106 +++++++++++++++++++++
 .../main/resources/sql/supported/dml/presto.xml    |   5 +
 2 files changed, 111 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 d810d052428..59c2515a85b 100644
--- a/test/it/parser/src/main/resources/case/dml/presto.xml
+++ b/test/it/parser/src/main/resources/case/dml/presto.xml
@@ -1940,4 +1940,110 @@
         </lock>
     </select>
 
+    <select sql-case-id="presto_select_is_null">
+        <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>
+        <where start-index="22" stop-index="39">
+            <expr>
+                <binary-operation-expression start-index="28" stop-index="39">
+                    <left>
+                        <column name="flag" start-index="28" stop-index="31" />
+                    </left>
+                    <operator>IS</operator>
+                    <right>
+                        <literal-expression value="NULL" start-index="36" 
stop-index="39" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+        </where>
+    </select>
+
+    <select sql-case-id="presto_select_is_not_true">
+        <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>
+        <where start-index="22" stop-index="43">
+            <expr>
+                <binary-operation-expression start-index="28" stop-index="43">
+                    <left>
+                        <column name="flag" start-index="28" stop-index="31" />
+                    </left>
+                    <operator>IS</operator>
+                    <right>
+                        <literal-expression value="NOT TRUE" start-index="36" 
stop-index="43" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+        </where>
+    </select>
+
+    <select sql-case-id="presto_select_is_false">
+        <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>
+        <where start-index="22" stop-index="40">
+            <expr>
+                <binary-operation-expression start-index="28" stop-index="40">
+                    <left>
+                        <column name="flag" start-index="28" stop-index="31" />
+                    </left>
+                    <operator>IS</operator>
+                    <right>
+                        <literal-expression value="FALSE" start-index="36" 
stop-index="40" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+        </where>
+    </select>
+
+    <select sql-case-id="presto_select_in_param_markers" parameters="1, 1">
+        <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>
+        <where start-index="22" stop-index="45">
+            <expr>
+                <in-expression start-index="28" stop-index="45">
+                    <not>false</not>
+                    <left>
+                        <column name="order_id" start-index="28" 
stop-index="35" />
+                    </left>
+                    <right>
+                        <list-expression start-index="40" stop-index="45">
+                            <items>
+                                <literal-expression value="1" start-index="41" 
stop-index="41" />
+                                <parameter-marker-expression 
parameter-index="0" start-index="41" stop-index="41" />
+                            </items>
+                            <items>
+                                <literal-expression value="1" start-index="44" 
stop-index="44" />
+                                <parameter-marker-expression 
parameter-index="1" start-index="44" stop-index="44" />
+                            </items>
+                        </list-expression>
+                    </right>
+                </in-expression>
+            </expr>
+        </where>
+    </select>
+
+    <select sql-case-id="presto_select_distinctrow">
+        <from>
+            <simple-table name="t_order" start-index="26" stop-index="32" />
+        </from>
+        <projections distinct-row="true" start-index="19" stop-index="19">
+            <shorthand-projection start-index="19" stop-index="19" />
+        </projections>
+    </select>
+
 </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 ba9e05cf549..6a3546fb1ee 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
@@ -97,4 +97,9 @@
     <sql-case id="presto_delete_table_alias" value="DELETE FROM t_order AS o 
WHERE flag = 1" db-types="Presto" />
     <sql-case id="presto_select_lock_share_of_nowait" value="SELECT * FROM 
t_order FOR SHARE OF t_order NOWAIT" db-types="Presto" />
     <sql-case id="presto_select_lock_skip_locked" value="SELECT * FROM t_order 
FOR UPDATE OF t_order SKIP LOCKED" db-types="Presto" />
+    <sql-case id="presto_select_is_null" value="SELECT * FROM t_order WHERE 
flag IS NULL" db-types="Presto" />
+    <sql-case id="presto_select_is_not_true" value="SELECT * FROM t_order 
WHERE flag IS NOT TRUE" db-types="Presto" />
+    <sql-case id="presto_select_is_false" value="SELECT * FROM t_order WHERE 
flag IS FALSE" db-types="Presto" />
+    <sql-case id="presto_select_in_param_markers" value="SELECT * FROM t_order 
WHERE order_id IN (?, ?)" db-types="Presto" />
+    <sql-case id="presto_select_distinctrow" value="SELECT DISTINCTROW * FROM 
t_order" db-types="Presto" />
 </sql-cases>

Reply via email to