You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/07/25 12:47:49 UTC

[GitHub] [shardingsphere] ThanoshanMV opened a new pull request #11503: Add Oracle Select Model Clause Definition

ThanoshanMV opened a new pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503


   #10111 
   
   Hi @wgy8283335, I've added Oracle [SELECT](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html#GUID-CFA006CA-6FF1-4972-821E-6996142A51C6) model clause. Please check it.
   
   Changes proposed in this pull request:
   - Added Oracle `SELECT` model clause definition.
   - Added test cases for model clause.
   - Created `modelSegment` to get `SELECT` statements from `referenceModel`, and `cellAssignment`, to get column values from `cellAssignment` and to get order by segments from `modelRulesClause`.
   - Modified the `aggregationFunction` by adding [analyticClause](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056). Here's the documentation for existing aggregate functions: [MIN](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/MIN.html#GUID-F7F04E18-1AD8-4D15-9491-4622AD847A74), [MAX](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/MAX.html#GUID-E5372020-A6DA-44BF-93BE-DA8C3F74CD01), [SUM](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SUM.html#GUID-5610BE2C-CFE5-446F-A1F7-B924B5663220), [COUNT](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/COUNT.html#GUID-AEF08B79-024D-4E3A-B362-9715FB011776), [AVG](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/AVG.html#GUID-B64BCBF1-DAA0-4D88-9821-2C4D3FDE5E4A), [GROUPING](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/GROUPING.html#GUID
 -82E6084A-0BDF-4587-A40E-36899783F073).
   - I added a new rule in `simpleExpr` to support expressions coming from `modelRulesClause`'s `expr`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r682773955



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/generic/ModelSegment.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.segment.generic;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Model segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class ModelSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    

Review comment:
       Since we're keeping those segments, I uncommented test cases except for SQL case id `select_with_model_with_reference_models` and modified the `modelExpr` accordingly. 
   
   In `select_with_model_with_reference_models`, it's quite complex to modify `modelExpr` to match.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-895070586


   I'll check the build failure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r682746980



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       Hi @wgy8283335, I've added `condition` rule.
   
   In `jsonCondition`, here's the [diagram](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/diagrams-basic-sql-json-path-expression-syntax.html) for `jsonBasicPathExpr` and `jsonBasicPathExpr`'s expression explanation [documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/json-path-expressions.html#GUID-AEBAD813-99AB-418A-93AB-F96BC1658618).

##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/generic/ModelSegment.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.segment.generic;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Model segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class ModelSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    

Review comment:
       Since we're keeping those segments, I uncommented test cases except for SQL case id `select_with_model_with_reference_models` and modified the `modelExpr` accordingly. 
   
   In `select_with_model_with_reference_models`, it's quite complex to modify `modelExpr` to match.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-891705050


   > Hi is it time to merge this one? @wgy8283335 @ThanoshanMV
   
   No @tristaZero, I'm currently adding `condition` rule based on this [documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Conditions.html#GUID-C2E3ED44-16E7-4924-9125-E1693B1022A8). After adding that, I'll have to let know @wgy8283335 to review it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r682192494



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/generic/ModelSegment.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.segment.generic;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Model segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class ModelSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    

Review comment:
       I think we could keep them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680547304



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/generic/ModelSegment.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.segment.generic;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Model segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class ModelSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    

Review comment:
       Okay @wgy8283335, if those four segments aren't necessary, we can remove them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r682746980



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       Hi @wgy8283335, I've added `condition` rule.
   
   In `jsonCondition`, here's the [diagram](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/diagrams-basic-sql-json-path-expression-syntax.html) for `jsonBasicPathExpr` and `jsonBasicPathExpr`'s expression explanation [documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/json-path-expressions.html#GUID-AEBAD813-99AB-418A-93AB-F96BC1658618).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 merged pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 merged pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fb9387d) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d951f5f407d900fcd69bf73848b08e45091bbe05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d951f5f) will **increase** coverage by `0.55%`.
   > The diff coverage is `42.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   + Coverage     63.18%   63.74%   +0.55%     
   - Complexity     1096     1122      +26     
   ============================================
     Files          2230     2255      +25     
     Lines         34069    34494     +425     
     Branches       5936     6034      +98     
   ============================================
   + Hits          21527    21987     +460     
   + Misses        10801    10732      -69     
   - Partials       1741     1775      +34     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.34% <84.44%> (+1.67%)` | :arrow_up: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `74.07% <100.00%> (ø)` | |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...itializer/impl/GovernanceBootstrapInitializer.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9pbml0aWFsaXplci9pbXBsL0dvdmVybmFuY2VCb290c3RyYXBJbml0aWFsaXplci5qYXZh) | `29.41% <0.00%> (-31.70%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d951f5f...fb9387d](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680541323



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
##########
@@ -416,6 +416,7 @@ simpleExpr
     | ROW? LP_ expr (COMMA_ expr)* RP_
     | EXISTS? subquery
     | LBE_ identifier expr RBE_
+    | (owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?

Review comment:
       I added `(owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?` rule to support for expressions coming from `modelRulesClause`'s right-hand side assignment.
   
   ![modelRulesClauseDefinition](https://user-images.githubusercontent.com/48581379/127779755-900bcd33-d2ce-44d7-9f74-feac2c1a3838.png)
   
   ![modelRulesClauseRule](https://user-images.githubusercontent.com/48581379/127779768-9f514565-4414-43f2-944d-f4bda990b61c.png)
   
   I found out the actual [definition](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Model-Expressions.html#GUID-83D3FD56-8346-4D3F-A49E-5FE41FE19257) of `modelRulesClause`'s right-hand side assignment. 
   
   ![RightHandsideRule](https://user-images.githubusercontent.com/48581379/127779923-8fef8e16-9b46-41ba-a50f-cbc98cffbd67.png)
   
   I'll remove the rule `(owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?` as it's not appropriate and update the `modelRuleClause`'s right-hand side `expr` to `modelExpr`.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-895262787


   > I'll check the build failure.
   
   I think since we explicitly specified `A : 'A'`, we can't add `a` in keywords. So, I changed all the keywords in Oracle SQL test cases which consist of `a` to block letters.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-890566599


   > @ThanoshanMV Hi, there are too many changes. Next time you could split them into different prs.
   
   Sorry @wgy8283335, next time I'll split the PRs correctly, so it's easy to review.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-890567921


   > * Modified the `aggregationFunction` by adding [analyticClause](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Analytic-Functions.html#GUID-527832F7-63C0-4445-8C16-307FA5084056). Here's the documentation for existing aggregate functions: [MIN](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/MIN.html#GUID-F7F04E18-1AD8-4D15-9491-4622AD847A74), [MAX](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/MAX.html#GUID-E5372020-A6DA-44BF-93BE-DA8C3F74CD01), [SUM](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SUM.html#GUID-5610BE2C-CFE5-446F-A1F7-B924B5663220), [COUNT](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/COUNT.html#GUID-AEF08B79-024D-4E3A-B362-9715FB011776), [AVG](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/AVG.html#GUID-B64BCBF1-DAA0-4D88-9821-2C4D3FDE5E4A), [GROUPING](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/GROUPING.html#GU
 ID-82E6084A-0BDF-4587-A40E-36899783F073).
   
   I made the above changes to successfully parse SQL case id `select_with_model_dimension` but after adding `modelExpr`, the parsing happens successfully using `modelExpr`'s `analyticFunction`
   
   ![ParsingWithAnalyticFunction](https://user-images.githubusercontent.com/48581379/127781856-59ccf24f-ed51-48de-8ed4-13b1dab7fad1.png)
   
   I think maybe we can remove the changes made to `aggregationFunction` rule and fix its changes in another PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680595371



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       OK.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-892801366


   `multisetCondition`'s `isASetCondition` requires `A` as a keyword like in the below image:
   
   ![isACondition](https://user-images.githubusercontent.com/48581379/128218745-d3117080-f1c1-436b-ae02-2b84b607c156.png)
   
   How can we define it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fb9387d) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d951f5f407d900fcd69bf73848b08e45091bbe05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d951f5f) will **increase** coverage by `0.55%`.
   > The diff coverage is `42.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   + Coverage     63.18%   63.74%   +0.55%     
   - Complexity     1096     1122      +26     
   ============================================
     Files          2230     2255      +25     
     Lines         34069    34494     +425     
     Branches       5936     6034      +98     
   ============================================
   + Hits          21527    21987     +460     
   + Misses        10801    10732      -69     
   - Partials       1741     1775      +34     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.34% <84.44%> (+1.67%)` | :arrow_up: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `74.07% <100.00%> (ø)` | |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...itializer/impl/GovernanceBootstrapInitializer.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9pbml0aWFsaXplci9pbXBsL0dvdmVybmFuY2VCb290c3RyYXBJbml0aWFsaXplci5qYXZh) | `29.41% <0.00%> (-31.70%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d951f5f...fb9387d](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-892801366


   `multisetCondition`'s `isASetCondition` requires `A` as a keyword like in the below image:
   
   ![isACondition](https://user-images.githubusercontent.com/48581379/128218745-d3117080-f1c1-436b-ae02-2b84b607c156.png)
   
   How can we define it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r682211677



##########
File path: shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
##########
@@ -92,4 +92,14 @@
     <sql-case id="select_with_containers" value="SELECT * FROM CONTAINERS(employees)" db-types="Oracle" />
     <sql-case id="select_with_hierarchical_connect_by" value="SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name" db-types="Oracle" />
     <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL" />
+    <sql-case id="select_with_model_partition_dimension" value="SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER (s[prod='Mouse Pad', year=2001] = s['Mouse Pad', 1999] + s['Mouse Pad', 2000], 
+    s['Standard Mouse', 2002] = s['Standard Mouse', 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_dimension" value="SELECT country, year, sale, csum FROM (SELECT country, year, SUM(sale) sale FROM sales_view_ref GROUP BY country, year) MODEL DIMENSION BY (country, year) MEASURES (sale, 0 csum) RULES (csum[any, any] = SUM(sale) OVER (PARTITION BY country ORDER BY year ROWS UNBOUNDED PRECEDING)) ORDER BY country, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_single_column_for_loop" value="SELECT SUBSTR(country,1,20) country, SUBSTR(prod,1,15) prod, year, sales FROM sales_view WHERE country='Italy' MODEL RETURN UPDATED ROWS PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale sales) RULES (sales[FOR prod in ('Mouse Pad', 'Bounce', 'Y Box'), 2005] = 1.3 * sales[cv(prod), 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_model" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN ('Canada', 'Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate AS er FROM dollar_conv) DIMENSION BY (country) MEASURES (er) IGNORE NAV MAIN main_model DIMENSION BY (country, year) 
+    MEASURES (SUM(sale) sales, 0 localsales, 0 dollarsales) IGNORE NAV RULES (localsales['Canada', 2005] = sales[cv(country), 2001] * 1.22, dollarsales['Canada', 2005] = sales[cv(country), 2001] * 1.22 * conv_refmodel.er['Canada'], localsales['Brazil', 2005] = sales[cv(country), 2001] * 1.34, dollarsales['Brazil', 2005] = sales['Brazil', 2001] * 1.34 * er['Brazil'])" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_models" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN  ('Canada','Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate FROM dollar_conv) DIMENSION BY (country c) MEASURES (exchange_rate er) IGNORE NAV REFERENCE growth_refmodel ON (SELECT country, year, growth_rate FROM growth_rate) DIMENSION BY (country c, year y) 

Review comment:
       I think we should keep `(PLUS_ modelExpr)?` in the definition.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-888781398


   I resolved the conflict @wgy8283335 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-895050733


   > What about use
   > 
   > ```
   > A : 'A';
   > ```
   
   Thank you, it's resolved!
   
   ![isAConditionFixed](https://user-images.githubusercontent.com/48581379/128680268-452dc8cc-b9eb-4fa1-aaba-e3e25c3814a2.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-890336050


   @wgy8283335 Hi could you double-check here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-890436964


   @ThanoshanMV Hi, there are too many changes.  Next time you could split them into different prs.
   For example, put the below into another pr.
   ```
   Modified the aggregationFunction by adding analyticClause. Here's the documentation for existing aggregate functions: MIN, MAX, SUM, COUNT, AVG, GROUPING.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-894372601


   > Try in Keyword.g4
   
   I tried in Keyword.g4, it states the mutually left-recursive error.
   
   ![MutuallyLeftRecursive](https://user-images.githubusercontent.com/48581379/128541658-8a98ad8f-56fc-41c7-aafd-dedf9ac518a3.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680551129



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       For now, I've added `condition` as `expr`. I've found out [documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Conditions.html#GUID-C2E3ED44-16E7-4924-9125-E1693B1022A8) for `condition`. In the next commit, I'll add them.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680437365



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
##########
@@ -416,6 +416,7 @@ simpleExpr
     | ROW? LP_ expr (COMMA_ expr)* RP_
     | EXISTS? subquery
     | LBE_ identifier expr RBE_
+    | (owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?

Review comment:
       Where is the definition of modelRulesClause's expr




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680438470



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       ![image](https://user-images.githubusercontent.com/22066046/127757362-f275ecc5-9bdb-4055-843f-a7ef9b391bfb.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0ec4abd) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d951f5f407d900fcd69bf73848b08e45091bbe05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d951f5f) will **increase** coverage by `0.18%`.
   > The diff coverage is `42.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   + Coverage     63.18%   63.36%   +0.18%     
   - Complexity     1096     1109      +13     
   ============================================
     Files          2230     2241      +11     
     Lines         34069    34343     +274     
     Branches       5936     6005      +69     
   ============================================
   + Hits          21527    21762     +235     
   - Misses        10801    10825      +24     
   - Partials       1741     1756      +15     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.34% <84.44%> (+1.67%)` | :arrow_up: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `74.07% <100.00%> (ø)` | |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
   | [...trics/prometheus/collector/BuildInfoCollector.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtcGx1Z2lucy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1wbHVnaW4tbWV0cmljcy9zaGFyZGluZ3NwaGVyZS1hZ2VudC1tZXRyaWNzLXByb21ldGhldXMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2FnZW50L21ldHJpY3MvcHJvbWV0aGV1cy9jb2xsZWN0b3IvQnVpbGRJbmZvQ29sbGVjdG9yLmphdmE=) | `72.22% <0.00%> (-17.78%)` | :arrow_down: |
   | ... and [62 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d951f5f...0ec4abd](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
tristaZero commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-891701537


   Hi is it time to merge this one? @wgy8283335 @ThanoshanMV 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680438524



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel
+    ;
+
+cellReferenceOptions
+    : ((IGNORE | KEEP) NAV)? (UNIQUE (DIMENSION | SINGLE REFERENCE))?
+    ;
+
+returnRowsClause
+    : RETURN (UPDATED | ALL) ROWS
+    ;
+
+referenceModel
+    : REFERENCE referenceModelName ON LP_ selectSubquery RP_ modelColumnClauses cellReferenceOptions?
+    ;
+
+mainModel
+    : (MAIN mainModelName)? modelColumnClauses cellReferenceOptions? modelRulesClause
+    ;
+
+modelColumnClauses
+    : (PARTITION BY LP_ expr alias? (COMMA_ expr alias?)* RP_)?
+    DIMENSION BY LP_ expr alias? (COMMA_ expr alias?)* RP_ MEASURES LP_ expr alias? (COMMA_ expr alias?)* RP_
+    ;
+
+modelRulesClause
+    : (RULES (UPDATE | UPSERT ALL?)? ((AUTOMATIC | SEQUENTIAL) ORDER)? modelIterateClause?)?
+    LP_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr (COMMA_ (UPDATE | UPSERT ALL?)? cellAssignment orderByClause? EQ_ expr)* RP_
+    ;
+
+modelIterateClause
+    : ITERATE LP_ numberLiterals RP_ (UNTIL LP_ expr RP_)?
+    ;
+
+cellAssignment
+    : measureColumn LBT_ (((expr | singleColumnForLoop) (COMMA_ (expr | singleColumnForLoop))*) | multiColumnForLoop) RBT_

Review comment:
       Where is condition?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7c8f54d) into [master](https://codecov.io/gh/apache/shardingsphere/commit/3d47befdef9a013c5b84cd3e56a284b64065fceb?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3d47bef) will **decrease** coverage by `0.05%`.
   > The diff coverage is `42.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   - Coverage     63.53%   63.47%   -0.06%     
   - Complexity     1195     1196       +1     
   ============================================
     Files          2307     2309       +2     
     Lines         34812    34915     +103     
     Branches       6043     6065      +22     
   ============================================
   + Hits          22117    22163      +46     
   - Misses        10916    10968      +52     
   - Partials       1779     1784       +5     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.34% <84.44%> (+1.67%)` | :arrow_up: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `73.14% <100.00%> (-0.93%)` | :arrow_down: |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | ... and [2 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [3d47bef...7c8f54d](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680442910



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/segment/generic/ModelSegment.java
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.sql.parser.sql.common.segment.generic;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.column.ColumnSegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.expr.subquery.SubquerySegment;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.dml.order.OrderBySegment;
+
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * Model segment.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class ModelSegment implements SQLSegment {
+    
+    private final int startIndex;
+    
+    private final int stopIndex;
+    

Review comment:
       Whether we need these four segments below should be discussed. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680547173



##########
File path: shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
##########
@@ -92,4 +92,14 @@
     <sql-case id="select_with_containers" value="SELECT * FROM CONTAINERS(employees)" db-types="Oracle" />
     <sql-case id="select_with_hierarchical_connect_by" value="SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name" db-types="Oracle" />
     <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL" />
+    <sql-case id="select_with_model_partition_dimension" value="SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER (s[prod='Mouse Pad', year=2001] = s['Mouse Pad', 1999] + s['Mouse Pad', 2000], 
+    s['Standard Mouse', 2002] = s['Standard Mouse', 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_dimension" value="SELECT country, year, sale, csum FROM (SELECT country, year, SUM(sale) sale FROM sales_view_ref GROUP BY country, year) MODEL DIMENSION BY (country, year) MEASURES (sale, 0 csum) RULES (csum[any, any] = SUM(sale) OVER (PARTITION BY country ORDER BY year ROWS UNBOUNDED PRECEDING)) ORDER BY country, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_single_column_for_loop" value="SELECT SUBSTR(country,1,20) country, SUBSTR(prod,1,15) prod, year, sales FROM sales_view WHERE country='Italy' MODEL RETURN UPDATED ROWS PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale sales) RULES (sales[FOR prod in ('Mouse Pad', 'Bounce', 'Y Box'), 2005] = 1.3 * sales[cv(prod), 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_model" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN ('Canada', 'Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate AS er FROM dollar_conv) DIMENSION BY (country) MEASURES (er) IGNORE NAV MAIN main_model DIMENSION BY (country, year) 
+    MEASURES (SUM(sale) sales, 0 localsales, 0 dollarsales) IGNORE NAV RULES (localsales['Canada', 2005] = sales[cv(country), 2001] * 1.22, dollarsales['Canada', 2005] = sales[cv(country), 2001] * 1.22 * conv_refmodel.er['Canada'], localsales['Brazil', 2005] = sales[cv(country), 2001] * 1.34, dollarsales['Brazil', 2005] = sales['Brazil', 2001] * 1.34 * er['Brazil'])" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_models" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN  ('Canada','Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate FROM dollar_conv) DIMENSION BY (country c) MEASURES (exchange_rate er) IGNORE NAV REFERENCE growth_refmodel ON (SELECT country, year, growth_rate FROM growth_rate) DIMENSION BY (country c, year y) 

Review comment:
       Though I tried to add `modelExpr` correctly, one SQL from [official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html#GUID-CFA006CA-6FF1-4972-821E-6996142A51C6) with SQL case id `select_with_model_partition_dimension` failed to parse as `modelExpr` isn't followed with `PLUS_` and another `modelExpr`:
   
   ![OfficialDocSQL](https://user-images.githubusercontent.com/48581379/127781112-29130dc8-7f66-4ff2-baf5-73e3532381c2.png)
   
   To parse the above SQL correctly, I modified the `modelExpr`:
   
   ![ModifiedModelExprDefinition](https://user-images.githubusercontent.com/48581379/127781217-fbb6de4e-1a4c-48f9-8264-98d2a61d8cdf.png)
   
   Please check them and let me know if anything which needs to be changed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-893942839


   > `multisetCondition`'s `isASetCondition` requires `A` as a keyword like in the below image:
   > 
   > ![isACondition](https://user-images.githubusercontent.com/48581379/128218745-d3117080-f1c1-436b-ae02-2b84b607c156.png)
   > 
   > How can we define it?
   
   Try in Keyword.g4


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680595322



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/BaseRule.g4
##########
@@ -416,6 +416,7 @@ simpleExpr
     | ROW? LP_ expr (COMMA_ expr)* RP_
     | EXISTS? subquery
     | LBE_ identifier expr RBE_
+    | (owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?

Review comment:
       That's great.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-887109751


   @ThanoshanMV There is a conflict.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680442018



##########
File path: shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
##########
@@ -92,4 +92,14 @@
     <sql-case id="select_with_containers" value="SELECT * FROM CONTAINERS(employees)" db-types="Oracle" />
     <sql-case id="select_with_hierarchical_connect_by" value="SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name" db-types="Oracle" />
     <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL" />
+    <sql-case id="select_with_model_partition_dimension" value="SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER (s[prod='Mouse Pad', year=2001] = s['Mouse Pad', 1999] + s['Mouse Pad', 2000], 
+    s['Standard Mouse', 2002] = s['Standard Mouse', 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_dimension" value="SELECT country, year, sale, csum FROM (SELECT country, year, SUM(sale) sale FROM sales_view_ref GROUP BY country, year) MODEL DIMENSION BY (country, year) MEASURES (sale, 0 csum) RULES (csum[any, any] = SUM(sale) OVER (PARTITION BY country ORDER BY year ROWS UNBOUNDED PRECEDING)) ORDER BY country, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_single_column_for_loop" value="SELECT SUBSTR(country,1,20) country, SUBSTR(prod,1,15) prod, year, sales FROM sales_view WHERE country='Italy' MODEL RETURN UPDATED ROWS PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale sales) RULES (sales[FOR prod in ('Mouse Pad', 'Bounce', 'Y Box'), 2005] = 1.3 * sales[cv(prod), 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_model" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN ('Canada', 'Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate AS er FROM dollar_conv) DIMENSION BY (country) MEASURES (er) IGNORE NAV MAIN main_model DIMENSION BY (country, year) 
+    MEASURES (SUM(sale) sales, 0 localsales, 0 dollarsales) IGNORE NAV RULES (localsales['Canada', 2005] = sales[cv(country), 2001] * 1.22, dollarsales['Canada', 2005] = sales[cv(country), 2001] * 1.22 * conv_refmodel.er['Canada'], localsales['Brazil', 2005] = sales[cv(country), 2001] * 1.34, dollarsales['Brazil', 2005] = sales['Brazil', 2001] * 1.34 * er['Brazil'])" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_models" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN  ('Canada','Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate FROM dollar_conv) DIMENSION BY (country c) MEASURES (exchange_rate er) IGNORE NAV REFERENCE growth_refmodel ON (SELECT country, year, growth_rate FROM growth_rate) DIMENSION BY (country c, year y) 

Review comment:
       The SQL is so complicated, are you sure the SQL could be executed succesfully?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680438048



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-oracle/src/main/antlr4/imports/oracle/DMLStatement.g4
##########
@@ -644,6 +644,54 @@ havingClause
     : HAVING expr
     ;
 
+modelClause
+    : MODEL cellReferenceOptions? returnRowsClause? (referenceModel+)? mainModel

Review comment:
       What about use 'referenceModel*' ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] wgy8283335 commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
wgy8283335 commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-894881359


   > > Try in Keyword.g4
   > 
   > I tried in Keyword.g4, it states the mutually left-recursive error.
   > 
   > ![MutuallyLeftRecursive](https://user-images.githubusercontent.com/48581379/128541658-8a98ad8f-56fc-41c7-aafd-dedf9ac518a3.png)
   
   What about use
   ```
   A : 'A';
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter edited a comment on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (28e8a58) into [master](https://codecov.io/gh/apache/shardingsphere/commit/d951f5f407d900fcd69bf73848b08e45091bbe05?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d951f5f) will **increase** coverage by `0.02%`.
   > The diff coverage is `19.04%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   + Coverage     63.18%   63.20%   +0.02%     
   - Complexity     1096     1109      +13     
   ============================================
     Files          2230     2241      +11     
     Lines         34069    34345     +276     
     Branches       5936     6005      +69     
   ============================================
   + Hits          21527    21709     +182     
   - Misses        10801    10877      +76     
   - Partials       1741     1759      +18     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `72.44% <28.88%> (-4.24%)` | :arrow_down: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `74.07% <100.00%> (ø)` | |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | [...sphere/scaling/core/job/schedule/JobScheduler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9qb2Ivc2NoZWR1bGUvSm9iU2NoZWR1bGVyLmphdmE=) | `22.22% <0.00%> (-29.63%)` | :arrow_down: |
   | [...tor/dml/impl/ShardingSelectStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ1NlbGVjdFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `77.77% <0.00%> (-22.23%)` | :arrow_down: |
   | ... and [68 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [d951f5f...28e8a58](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#issuecomment-886210545


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#11503](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b71e005) into [master](https://codecov.io/gh/apache/shardingsphere/commit/e332d94e817cccd07b2d6ea2e78a206654872d85?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e332d94) will **decrease** coverage by `0.05%`.
   > The diff coverage is `42.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/11503/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #11503      +/-   ##
   ============================================
   - Coverage     63.20%   63.15%   -0.06%     
   - Complexity     1095     1096       +1     
   ============================================
     Files          2226     2228       +2     
     Lines         34045    34148     +103     
     Branches       5937     5959      +22     
   ============================================
   + Hits          21517    21565      +48     
   - Misses        10787    10838      +51     
   - Partials       1741     1745       +4     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ql/dialect/handler/dml/SelectStatementHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9oYW5kbGVyL2RtbC9TZWxlY3RTdGF0ZW1lbnRIYW5kbGVyLmphdmE=) | `55.55% <0.00%> (-6.95%)` | :arrow_down: |
   | [...ct/statement/oracle/dml/OracleSelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvZGlhbGVjdC9zdGF0ZW1lbnQvb3JhY2xlL2RtbC9PcmFjbGVTZWxlY3RTdGF0ZW1lbnQuamF2YQ==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | [...rized/asserts/segment/model/ModelClauseAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zZWdtZW50L21vZGVsL01vZGVsQ2xhdXNlQXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...erts/statement/dml/impl/SelectStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZG1sL2ltcGwvU2VsZWN0U3RhdGVtZW50QXNzZXJ0LmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [.../domain/statement/dml/SelectStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc3RhdGVtZW50L2RtbC9TZWxlY3RTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <ø> (ø)` | |
   | [...r/statement/impl/OracleDMLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlRE1MU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `78.34% <84.44%> (+1.67%)` | :arrow_up: |
   | [...itor/statement/impl/OracleStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcmFjbGUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3JhY2xlL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3JhY2xlU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `74.07% <100.00%> (ø)` | |
   | [...domain/segment/impl/model/ExpectedModelClause.java](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvamF4Yi9jYXNlcy9kb21haW4vc2VnbWVudC9pbXBsL21vZGVsL0V4cGVjdGVkTW9kZWxDbGF1c2UuamF2YQ==) | `100.00% <100.00%> (ø)` | |
   | ... and [1 more](https://codecov.io/gh/apache/shardingsphere/pull/11503/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [e332d94...b71e005](https://codecov.io/gh/apache/shardingsphere/pull/11503?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] ThanoshanMV commented on a change in pull request #11503: Add Oracle Select Model Clause Definition

Posted by GitBox <gi...@apache.org>.
ThanoshanMV commented on a change in pull request #11503:
URL: https://github.com/apache/shardingsphere/pull/11503#discussion_r680545500



##########
File path: shardingsphere-test/shardingsphere-parser-test/src/main/resources/sql/supported/dml/select.xml
##########
@@ -92,4 +92,14 @@
     <sql-case id="select_with_containers" value="SELECT * FROM CONTAINERS(employees)" db-types="Oracle" />
     <sql-case id="select_with_hierarchical_connect_by" value="SELECT last_name, employee_id, manager_id FROM employees CONNECT BY employee_id = manager_id ORDER BY last_name" db-types="Oracle" />
     <sql-case id="select_union" value="SELECT order_id FROM t_order UNION SELECT order_id FROM t_order_item" db-types="MySQL" />
+    <sql-case id="select_with_model_partition_dimension" value="SELECT country, prod, year, s FROM sales_view_ref MODEL PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale s) IGNORE NAV UNIQUE DIMENSION RULES UPSERT SEQUENTIAL ORDER (s[prod='Mouse Pad', year=2001] = s['Mouse Pad', 1999] + s['Mouse Pad', 2000], 
+    s['Standard Mouse', 2002] = s['Standard Mouse', 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_dimension" value="SELECT country, year, sale, csum FROM (SELECT country, year, SUM(sale) sale FROM sales_view_ref GROUP BY country, year) MODEL DIMENSION BY (country, year) MEASURES (sale, 0 csum) RULES (csum[any, any] = SUM(sale) OVER (PARTITION BY country ORDER BY year ROWS UNBOUNDED PRECEDING)) ORDER BY country, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_single_column_for_loop" value="SELECT SUBSTR(country,1,20) country, SUBSTR(prod,1,15) prod, year, sales FROM sales_view WHERE country='Italy' MODEL RETURN UPDATED ROWS PARTITION BY (country) DIMENSION BY (prod, year) MEASURES (sale sales) RULES (sales[FOR prod in ('Mouse Pad', 'Bounce', 'Y Box'), 2005] = 1.3 * sales[cv(prod), 2001]) ORDER BY country, prod, year" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_model" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN ('Canada', 'Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate AS er FROM dollar_conv) DIMENSION BY (country) MEASURES (er) IGNORE NAV MAIN main_model DIMENSION BY (country, year) 
+    MEASURES (SUM(sale) sales, 0 localsales, 0 dollarsales) IGNORE NAV RULES (localsales['Canada', 2005] = sales[cv(country), 2001] * 1.22, dollarsales['Canada', 2005] = sales[cv(country), 2001] * 1.22 * conv_refmodel.er['Canada'], localsales['Brazil', 2005] = sales[cv(country), 2001] * 1.34, dollarsales['Brazil', 2005] = sales['Brazil', 2001] * 1.34 * er['Brazil'])" db-types="Oracle" />
+    <sql-case id="select_with_model_with_reference_models" value="SELECT SUBSTR(country,1,20) country, year, localsales, dollarsales FROM sales_view WHERE country IN  ('Canada','Brazil') GROUP BY country, year MODEL RETURN UPDATED ROWS REFERENCE conv_refmodel ON (SELECT country, exchange_rate FROM dollar_conv) DIMENSION BY (country c) MEASURES (exchange_rate er) IGNORE NAV REFERENCE growth_refmodel ON (SELECT country, year, growth_rate FROM growth_rate) DIMENSION BY (country c, year y) 

Review comment:
       With the previous `(owner DOT_)? name LBT_ expr (COMMA_ expr)* RBT_ simpleExpr?` rule, the above SQLs were executed successfully. 
   
   After removing the inappropriate above rule and changing `modelRuleClause`'s right-hand side `expr` to `modelExpr`, those above SQLs weren't executed successfully. 
   
   Except for SQL case ids `select_with_model_partition_dimension` and `select_with_model_dimension`, other SQLs were taken from [external source](https://docs.oracle.com/cd/B19306_01/server.102/b14223/sqlmodel.htm) and not from [official documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/SELECT.html#GUID-CFA006CA-6FF1-4972-821E-6996142A51C6). I added external source SQLs to check how parsing happens in `singleColumnForLoop`, `referenceModel` and so on.
   
   The parsing fails in `modelExpr`, here's an example with SQL case id `select_with_model_with_single_column_for_loop`:
   
   ![SQLParsingFails](https://user-images.githubusercontent.com/48581379/127780856-a1bcb4f6-07ed-4987-89e6-b396e5830038.png)
   
   I'll comment on all external source SQLs. Maybe it's better to remove the external source SQLs as we don't know whether they are aligned with Oracle 19?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org