You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2026/08/23 03:36:43 UTC

(shardingsphere) branch master updated: Add parser IT cases for Doris ARRAY_CUM_SUM function (#39571)

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

terrymanu 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 eeb072be8f4 Add parser IT cases for Doris ARRAY_CUM_SUM function (#39571)
eeb072be8f4 is described below

commit eeb072be8f467cb063d1650ebe43975e4b19c445
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sun Aug 23 11:36:37 2026 +0800

    Add parser IT cases for Doris ARRAY_CUM_SUM function (#39571)
    
    * Support Oracle bare CROSSEDITION trigger and XMLForest alias without AS from issue #27073
    
    - Make FORWARD/REVERSE optional in triggerEditionClause, since Oracle documents FORWARD as the default crossedition form
    - Accept alias without AS in exprWithAlias and xmlAsAliasOrEvalnameExpr for XMLATTRIBUTES, XMLELEMENT, XMLFOREST and XMLCOLATTVAL parameters
    - Add parser IT cases for the CREATE OR REPLACE trigger statements and XMLFOREST alias from the issue
    
    Fixes #27073
    
    * Support Oracle bare CROSSEDITION trigger and XMLForest alias without AS from issue #27073
    
    - Make FORWARD/REVERSE optional in triggerEditionClause, since Oracle documents FORWARD as the default crossedition form
    - Accept alias without AS in exprWithAlias and xmlAsAliasOrEvalnameExpr for XMLATTRIBUTES, XMLELEMENT, XMLFOREST and XMLCOLATTVAL parameters
    - Add parser IT cases for the CREATE OR REPLACE trigger statements and XMLFOREST alias from the issue
    
    Fixes #27073
    
    * Add parser IT cases for Doris ARRAY_CUM_SUM function
    
    ARRAY_CUM_SUM already parses through the generic regular-function path
    with array literals since #38248. Add InternalDorisParserIT coverage for
    the documented array-literal, empty-array and FROM-table forms to
    protect the syntax for #31503.
---
 .../resources/case/dml/select-special-function.xml | 65 ++++++++++++++++++++++
 .../sql/supported/dml/select-special-function.xml  |  3 +
 2 files changed, 68 insertions(+)

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 956be6d64b9..69962aced24 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
@@ -6371,4 +6371,69 @@
             <simple-table name="t_order" start-index="60" stop-index="66" />
         </from>
     </select>
+
+    <select sql-case-id="select_array_cum_sum" db-types="Doris">
+        <projections start-index="7" stop-index="30">
+            <expression-projection start-index="7" stop-index="30" text="ARRAY_CUM_SUM([1, 2, 3])">
+                <expr>
+                    <function function-name="ARRAY_CUM_SUM" text="ARRAY_CUM_SUM([1, 2, 3])" start-index="7" stop-index="30">
+                        <parameter>
+                            <list-expression start-index="21" stop-index="29">
+                                <items>
+                                    <literal-expression value="1" start-index="22" stop-index="22" />
+                                </items>
+                                <items>
+                                    <literal-expression value="2" start-index="25" stop-index="25" />
+                                </items>
+                                <items>
+                                    <literal-expression value="3" start-index="28" stop-index="28" />
+                                </items>
+                            </list-expression>
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_array_cum_sum_empty_array" db-types="Doris">
+        <projections start-index="7" stop-index="23">
+            <expression-projection start-index="7" stop-index="23" text="ARRAY_CUM_SUM([])">
+                <expr>
+                    <function function-name="ARRAY_CUM_SUM" text="ARRAY_CUM_SUM([])" start-index="7" stop-index="23">
+                        <parameter>
+                            <list-expression start-index="21" stop-index="22" />
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+    </select>
+
+    <select sql-case-id="select_array_cum_sum_from_table" db-types="Doris">
+        <projections start-index="7" stop-index="30">
+            <expression-projection start-index="7" stop-index="30" text="ARRAY_CUM_SUM([1, 2, 3])">
+                <expr>
+                    <function function-name="ARRAY_CUM_SUM" text="ARRAY_CUM_SUM([1, 2, 3])" start-index="7" stop-index="30">
+                        <parameter>
+                            <list-expression start-index="21" stop-index="29">
+                                <items>
+                                    <literal-expression value="1" start-index="22" stop-index="22" />
+                                </items>
+                                <items>
+                                    <literal-expression value="2" start-index="25" stop-index="25" />
+                                </items>
+                                <items>
+                                    <literal-expression value="3" start-index="28" stop-index="28" />
+                                </items>
+                            </list-expression>
+                        </parameter>
+                    </function>
+                </expr>
+            </expression-projection>
+        </projections>
+        <from>
+            <simple-table name="t_order" start-index="37" stop-index="43" />
+        </from>
+    </select>
 </sql-parser-test-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 0a689e7547f..60d00a4c6e5 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
@@ -352,4 +352,7 @@
     <sql-case id="select_split_by_string_with_column" value="SELECT SPLIT_BY_STRING(order_notes, '::') FROM t_order" db-types="Doris" />
     <sql-case id="select_split_by_string_with_placeholder" value="SELECT SPLIT_BY_STRING(?, ?) FROM t_order" case-types="placeholder" db-types="Doris" />
     <sql-case id="select_split_by_string_with_nested_function" value="SELECT SPLIT_BY_STRING(CONCAT(order_notes, '-'), '::') FROM t_order" db-types="Doris" />
+    <sql-case id="select_array_cum_sum" value="SELECT ARRAY_CUM_SUM([1, 2, 3])" db-types="Doris" />
+    <sql-case id="select_array_cum_sum_empty_array" value="SELECT ARRAY_CUM_SUM([])" db-types="Doris" />
+    <sql-case id="select_array_cum_sum_from_table" value="SELECT ARRAY_CUM_SUM([1, 2, 3]) FROM t_order" db-types="Doris" />
 </sql-cases>