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 2020/10/13 12:11:59 UTC

[GitHub] [shardingsphere] dongzl opened a new pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

dongzl opened a new pull request #7778:
URL: https://github.com/apache/shardingsphere/pull/7778


   For #6478 .
   
   Changes proposed in this pull request:
   - add SQLServer parser select aggregation clause, support except & intersect.
   - add SQLServer except & intersect keywords.
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tristaZero edited a comment on pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

Posted by GitBox <gi...@apache.org>.
tristaZero edited a comment on pull request #7778:
URL: https://github.com/apache/shardingsphere/pull/7778#issuecomment-708870712


   @dongzl @jingshanglu Great work. :-)
   Your hardworking motivated this community. πŸ‘ 


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
##########
@@ -73,11 +73,15 @@ multipleTableNames
     ;
 
 select 
-    : unionClause
+    : aggregationClause
+    ;
+
+aggregationClause
+    : selectClause ((UNION (ALL)? | EXCEPT | INTERSECT) selectClause)*
     ;
 
 unionClause
-    : selectClause (UNION (ALL | DISTINCT)? selectClause)*
+    : selectClause (UNION (ALL)? selectClause)*
     ;

Review comment:
       Can these two rules be combined? Since the reference in the subquery is unionClause. The subquery and SELECT should have the same semantics,right?




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] codecov-io edited a comment on pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=h1) Report
   > Merging [#7778](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=desc) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5bde8b2aa27657e9459fb20929cfd4ef83dcddcf?el=desc) will **decrease** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/7778/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7778      +/-   ##
   ============================================
   - Coverage     74.98%   74.97%   -0.01%     
     Complexity      524      524              
   ============================================
     Files          1415     1416       +1     
     Lines         22537    22538       +1     
     Branches       4052     4051       -1     
   ============================================
   - Hits          16899    16898       -1     
   - Misses         4552     4553       +1     
   - Partials       1086     1087       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=tree) | Coverage Ξ” | Complexity Ξ” | |
   |---|---|---|---|
   | [...er/sqlserver/visitor/impl/SQLServerDMLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1zcWxzZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvc3Fsc2VydmVyL3Zpc2l0b3IvaW1wbC9TUUxTZXJ2ZXJETUxWaXNpdG9yLmphdmE=) | `85.76% <100.00%> (ΓΈ)` | `0.00 <0.00> (ΓΈ)` | |
   | [...ext/transaction/GovernanceTransactionContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS1jb3JlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC90cmFuc2FjdGlvbi9Hb3Zlcm5hbmNlVHJhbnNhY3Rpb25Db250ZXh0cy5qYXZh) | `93.33% <0.00%> (-6.67%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...re/scaling/core/schedule/ScalingTaskScheduler.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9zY2hlZHVsZS9TY2FsaW5nVGFza1NjaGVkdWxlci5qYXZh) | `78.00% <0.00%> (-2.00%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [.../physical/model/schema/PhysicalSchemaMetaData.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9tb2RlbC9waHlzaWNhbC9tb2RlbC9zY2hlbWEvUGh5c2ljYWxTY2hlbWFNZXRhRGF0YS5qYXZh) | `94.44% <0.00%> (-0.56%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...aling/core/execute/executor/record/DataRecord.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9leGVjdXRlL2V4ZWN1dG9yL3JlY29yZC9EYXRhUmVjb3JkLmphdmE=) | `100.00% <0.00%> (ΓΈ)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...rser/sql/common/statement/dml/DeleteStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kbWwvRGVsZXRlU3RhdGVtZW50LmphdmE=) | `50.00% <0.00%> (ΓΈ)` | `1.00% <0.00%> (ΓΈ%)` | |
   | [...rser/sql/common/statement/dml/InsertStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kbWwvSW5zZXJ0U3RhdGVtZW50LmphdmE=) | `40.00% <0.00%> (ΓΈ)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...rser/sql/common/statement/dml/SelectStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kbWwvU2VsZWN0U3RhdGVtZW50LmphdmE=) | `25.00% <0.00%> (ΓΈ)` | `1.00% <0.00%> (ΓΈ%)` | |
   | [...rser/sql/common/statement/dml/UpdateStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kbWwvVXBkYXRlU3RhdGVtZW50LmphdmE=) | `50.00% <0.00%> (ΓΈ)` | `1.00% <0.00%> (ΓΈ%)` | |
   | [...er/sql/common/statement/ddl/TruncateStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLXN0YXRlbWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc3FsL3BhcnNlci9zcWwvY29tbW9uL3N0YXRlbWVudC9kZGwvVHJ1bmNhdGVTdGF0ZW1lbnQuamF2YQ==) | `0.00% <0.00%> (ΓΈ)` | `0.00% <0.00%> (ΓΈ%)` | |
   | ... and [187 more](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Ξ” = absolute <relative> (impact)`, `ΓΈ = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=footer). Last update [5bde8b2...5cfa3d7](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] jingshanglu merged pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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


   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] codecov-io commented on pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=h1) Report
   > Merging [#7778](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=desc) into [master](https://codecov.io/gh/apache/shardingsphere/commit/5bde8b2aa27657e9459fb20929cfd4ef83dcddcf?el=desc) will **decrease** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/7778/graphs/tree.svg?width=650&height=150&src=pr&token=ZvlXpWa7so)](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7778      +/-   ##
   ============================================
   - Coverage     74.98%   74.98%   -0.01%     
     Complexity      524      524              
   ============================================
     Files          1415     1415              
     Lines         22537    22539       +2     
     Branches       4052     4052              
   ============================================
   + Hits          16899    16900       +1     
     Misses         4552     4552              
   - Partials       1086     1087       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=tree) | Coverage Ξ” | Complexity Ξ” | |
   |---|---|---|---|
   | [...er/sqlserver/visitor/impl/SQLServerDMLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1zcWxzZXJ2ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvc3Fsc2VydmVyL3Zpc2l0b3IvaW1wbC9TUUxTZXJ2ZXJETUxWaXNpdG9yLmphdmE=) | `85.81% <100.00%> (+0.04%)` | `0.00 <0.00> (ΓΈ)` | |
   | [...ext/transaction/GovernanceTransactionContexts.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS9zaGFyZGluZ3NwaGVyZS1nb3Zlcm5hbmNlLWNvcmUvc2hhcmRpbmdzcGhlcmUtZ292ZXJuYW5jZS1jb3JlLWNvbnRleHQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2dvdmVybmFuY2UvY29udGV4dC90cmFuc2FjdGlvbi9Hb3Zlcm5hbmNlVHJhbnNhY3Rpb25Db250ZXh0cy5qYXZh) | `93.33% <0.00%> (-6.67%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...re/scaling/core/schedule/ScalingTaskScheduler.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtc2NhbGluZy9zaGFyZGluZ3NwaGVyZS1zY2FsaW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NjYWxpbmcvY29yZS9zY2hlZHVsZS9TY2FsaW5nVGFza1NjaGVkdWxlci5qYXZh) | `78.00% <0.00%> (-2.00%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...cal/model/column/PhysicalColumnMetaDataLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9tb2RlbC9waHlzaWNhbC9tb2RlbC9jb2x1bW4vUGh5c2ljYWxDb2x1bW5NZXRhRGF0YUxvYWRlci5qYXZh) | `71.11% <0.00%> (+0.65%)` | `0.00% <0.00%> (ΓΈ%)` | |
   | [...gsphere/proxy/config/ProxyConfigurationLoader.java](https://codecov.io/gh/apache/shardingsphere/pull/7778/diff?src=pr&el=tree#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9jb25maWcvUHJveHlDb25maWd1cmF0aW9uTG9hZGVyLmphdmE=) | `51.51% <0.00%> (+3.03%)` | `0.00% <0.00%> (ΓΈ%)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Ξ” = absolute <relative> (impact)`, `ΓΈ = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=footer). Last update [5bde8b2...6c5349c](https://codecov.io/gh/apache/shardingsphere/pull/7778?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] dongzl commented on a change in pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4
##########
@@ -73,11 +73,15 @@ multipleTableNames
     ;
 
 select 
-    : unionClause
+    : aggregationClause
+    ;
+
+aggregationClause
+    : selectClause ((UNION (ALL)? | EXCEPT | INTERSECT) selectClause)*
     ;
 
 unionClause
-    : selectClause (UNION (ALL | DISTINCT)? selectClause)*
+    : selectClause (UNION (ALL)? selectClause)*
     ;

Review comment:
       Hi @jingshanglu , You are right, I consider merge `unionClause` to  `aggregationClause` next PR at beginning, 
   now I will do it in advance.  




----------------------------------------------------------------
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.

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



[GitHub] [shardingsphere] tristaZero commented on pull request #7778: Add SQLServer parser select aggregation clause, support except & intersect.

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


   @dongzl @jingshanglu Great work. :-)
   Your hardworking motivated this community!


----------------------------------------------------------------
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.

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