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

chengzhang 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 69f256bdf4c Support Oracle PREDICTION_BOUNDS function parse (#28001)
69f256bdf4c is described below

commit 69f256bdf4ccbade26789359fc666cf6baf23184
Author: Zichao <[email protected]>
AuthorDate: Thu Aug 10 13:44:55 2023 +1200

    Support Oracle PREDICTION_BOUNDS function parse (#28001)
---
 .../src/main/antlr4/imports/oracle/BaseRule.g4     |  2 +-
 .../main/resources/case/dml/select-expression.xml  | 30 ++++++++++++++++++++++
 .../sql/supported/dml/select-expression.xml        |  1 +
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git 
a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/BaseRule.g4 
b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/BaseRule.g4
index 993033b3a7c..b4cf261c50b 100644
--- a/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/BaseRule.g4
+++ b/parser/sql/dialect/oracle/src/main/antlr4/imports/oracle/BaseRule.g4
@@ -792,7 +792,7 @@ featureFunction
     ;
 
 featureFunctionName
-    : FEATURE_COMPARE | FEATURE_DETAILS | FEATURE_SET | FEATURE_ID | 
FEATURE_VALUE | CLUSTER_DETAILS | CLUSTER_DISTANCE | CLUSTER_ID | 
CLUSTER_PROBABILITY | CLUSTER_SET | PREDICTION_PROBABILITY | PREDICTION_SET
+    : FEATURE_COMPARE | FEATURE_DETAILS | FEATURE_SET | FEATURE_ID | 
FEATURE_VALUE | CLUSTER_DETAILS | CLUSTER_DISTANCE | CLUSTER_ID | 
CLUSTER_PROBABILITY | CLUSTER_SET | PREDICTION_PROBABILITY | PREDICTION_SET | 
PREDICTION_BOUNDS
     ;
 
 miningAttributeClause
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 5728be34854..491c2febf3c 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
@@ -2822,4 +2822,34 @@
             <simple-table name="departments" alias="d" start-index="107" 
stop-index="119" />
         </from>
     </select>
+    
+    <select sql-case-id="select_prediction_bounds_function">
+        <projections start-index="7" stop-index="13">
+            <column-projection name="cust_id" start-index="7" stop-index="13" 
/>
+        </projections>
+        <from>
+            <simple-table name="mining_data_apply_v" start-index="20" 
stop-index="38" />
+        </from>
+        <where start-index="40" stop-index="107">
+            <expr>
+                <binary-operation-expression start-index="46" stop-index="107">
+                    <left>
+                        <binary-operation-expression start-index="46" 
stop-index="102">
+                            <left>
+                                <function function-name="PREDICTION_BOUNDS" 
start-index="46" stop-index="96" 
text="PREDICTION_BOUNDS(glmr_sh_regr_sample,0.98 USING *)" />
+                            </left>
+                            <operator>.</operator>
+                            <right>
+                                <column start-index="98" stop-index="102" 
name="LOWER" />
+                            </right>
+                        </binary-operation-expression>
+                    </left>
+                    <operator>=</operator>
+                    <right>
+                        <literal-expression start-index="106" stop-index="107" 
value="24" />
+                    </right>
+                </binary-operation-expression>
+            </expr>
+        </where>
+    </select>
 </sql-parser-test-cases>
diff --git 
a/test/it/parser/src/main/resources/sql/supported/dml/select-expression.xml 
b/test/it/parser/src/main/resources/sql/supported/dml/select-expression.xml
index 3603aedd21e..20e7320239e 100644
--- a/test/it/parser/src/main/resources/sql/supported/dml/select-expression.xml
+++ b/test/it/parser/src/main/resources/sql/supported/dml/select-expression.xml
@@ -119,4 +119,5 @@
     <sql-case id="select_prediction_probability_function" value="SELECT 
PREDICTION_PROBABILITY(dt_sh_clas_sample, 1 USING *) cust_card_prob FROM 
mining_data_apply_v WHERE cust_id = 101488;" db-types="Oracle" />
     <sql-case id="select_prediction_set_function" value="SELECT 
PREDICTION_SET(dt_sh_clas_sample COST MODEL USING *) pset FROM 
mining_data_apply_v WHERE cust_id = 100011" db-types="Oracle" />
     <sql-case id="select_cursor_function" value="SELECT CURSOR(SELECT salary, 
commission_pct FROM employees e WHERE e.department_id = d.department_id) FROM 
departments d;" db-types="Oracle" />
+    <sql-case id="select_prediction_bounds_function" value="SELECT cust_id 
FROM mining_data_apply_v WHERE PREDICTION_BOUNDS(glmr_sh_regr_sample,0.98 USING 
*).LOWER = 24;" db-types="Oracle" />
 </sql-cases>

Reply via email to