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 2022/10/23 12:15:24 UTC

[GitHub] [shardingsphere] jiangML opened a new pull request, #21704: Refactor distsql about shadow related syntax #21696

jiangML opened a new pull request, #21704:
URL: https://github.com/apache/shardingsphere/pull/21704

   Fixes #21696.
   
   Changes proposed in this pull request:
   - Remove: CREATE SHADOW ALGORITHM
   - Remove: ALTER SHADOW ALGORITHM
   - Add: SHOW DEFAULT SHADOW ALGORITHM
   - Add: ALTER DEFAULT SHADOW ALGORITHM
   - Refactor: CREATE DEFAULT SHADOW ALGORITHM NAME EQ algorithmName -> CREATE DEFAULT SHADOW ALGORITHM shadowAlgorithmDefinition
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] RaigorJiang merged pull request #21704: Refactor distsql about shadow related syntax #21696

Posted by GitBox <gi...@apache.org>.
RaigorJiang merged PR #21704:
URL: https://github.com/apache/shardingsphere/pull/21704


-- 
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] RaigorJiang commented on a diff in pull request #21704: Refactor distsql about shadow related syntax #21696

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #21704:
URL: https://github.com/apache/shardingsphere/pull/21704#discussion_r1003086021


##########
test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/rql/ShowDefaultShadowAlgorithmsStatementTestCase.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql;
+
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.DatabaseContainedTestCase;
+
+/**
+ * Show default shadow algorithm statement test case.
+ */
+public class ShowDefaultShadowAlgorithmsStatementTestCase extends DatabaseContainedTestCase {
+    

Review Comment:
   Please remove the useless blank line.



-- 
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 #21704: Refactor distsql about shadow related syntax #21696

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

   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/21704?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 [#21704](https://codecov.io/gh/apache/shardingsphere/pull/21704?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a6c0154) into [master](https://codecov.io/gh/apache/shardingsphere/commit/63f8a4f297b15910ee3d69cf167235272da010bc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (63f8a4f) will **decrease** coverage by `0.07%`.
   > The diff coverage is `23.91%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #21704      +/-   ##
   ============================================
   - Coverage     61.02%   60.95%   -0.08%     
   + Complexity     2505     2497       -8     
   ============================================
     Files          4111     4113       +2     
     Lines         57375    57410      +35     
     Branches       9696     9700       +4     
   ============================================
   - Hits          35013    34993      -20     
   - Misses        19455    19510      +55     
     Partials       2907     2907              
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/21704?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...er/query/DefaultShadowAlgorithmQueryResultSet.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-ZmVhdHVyZXMvc2hhZG93L2Rpc3RzcWwvaGFuZGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhZG93L2Rpc3RzcWwvaGFuZGxlci9xdWVyeS9EZWZhdWx0U2hhZG93QWxnb3JpdGhtUXVlcnlSZXN1bHRTZXQuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...sql/parser/core/ShadowDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-ZmVhdHVyZXMvc2hhZG93L2Rpc3RzcWwvcGFyc2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvZGlzdHNxbC9wYXJzZXIvY29yZS9TaGFkb3dEaXN0U1FMU3RhdGVtZW50VmlzaXRvci5qYXZh) | `44.11% <0.00%> (ø)` | |
   | [.../CreateDefaultShadowAlgorithmStatementUpdater.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-ZmVhdHVyZXMvc2hhZG93L2Rpc3RzcWwvaGFuZGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhZG93L2Rpc3RzcWwvaGFuZGxlci91cGRhdGUvQ3JlYXRlRGVmYXVsdFNoYWRvd0FsZ29yaXRobVN0YXRlbWVudFVwZGF0ZXIuamF2YQ==) | `7.40% <5.55%> (-23.37%)` | :arrow_down: |
   | [...l/CreateDefaultShadowAlgorithmStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2Fzc2VydHMvc3RhdGVtZW50L2Rpc3RzcWwvcmRsL2NyZWF0ZS9pbXBsL0NyZWF0ZURlZmF1bHRTaGFkb3dBbGdvcml0aG1TdGF0ZW1lbnRBc3NlcnQuamF2YQ==) | `80.00% <100.00%> (+13.33%)` | :arrow_up: |
   | [...eterized/jaxb/cases/domain/SQLParserTestCases.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2pheGIvY2FzZXMvZG9tYWluL1NRTFBhcnNlclRlc3RDYXNlcy5qYXZh) | `99.31% <100.00%> (ø)` | |
   | [...CreateDefaultShadowAlgorithmStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2pheGIvY2FzZXMvZG9tYWluL3N0YXRlbWVudC9kaXN0c3FsL3JkbC9jcmVhdGUvQ3JlYXRlRGVmYXVsdFNoYWRvd0FsZ29yaXRobVN0YXRlbWVudFRlc3RDYXNlLmphdmE=) | `100.00% <100.00%> (ø)` | |
   | [.../ShowDefaultShadowAlgorithmsStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2pheGIvY2FzZXMvZG9tYWluL3N0YXRlbWVudC9kaXN0c3FsL3JxbC9TaG93RGVmYXVsdFNoYWRvd0FsZ29yaXRobXNTdGF0ZW1lbnRUZXN0Q2FzZS5qYXZh) | `100.00% <100.00%> (ø)` | |
   | [...l/alter/AlterShadowAlgorithmStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2pheGIvY2FzZXMvZG9tYWluL3N0YXRlbWVudC9kaXN0c3FsL3JkbC9hbHRlci9BbHRlclNoYWRvd0FsZ29yaXRobVN0YXRlbWVudFRlc3RDYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...create/CreateShadowAlgorithmStatementTestCase.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2pheGIvY2FzZXMvZG9tYWluL3N0YXRlbWVudC9kaXN0c3FsL3JkbC9jcmVhdGUvQ3JlYXRlU2hhZG93QWxnb3JpdGhtU3RhdGVtZW50VGVzdENhc2UuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...ate/impl/CreateShadowAlgorithmStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/21704/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-dGVzdC9wYXJzZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Rlc3Qvc3FsL3BhcnNlci9wYXJhbWV0ZXJpemVkL2Fzc2VydHMvc3RhdGVtZW50L2Rpc3RzcWwvcmRsL2NyZWF0ZS9pbXBsL0NyZWF0ZVNoYWRvd0FsZ29yaXRobVN0YXRlbWVudEFzc2VydC5qYXZh) | `0.00% <0.00%> (-77.78%)` | :arrow_down: |
   | ... and [4 more](https://codecov.io/gh/apache/shardingsphere/pull/21704/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) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?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] jiangML commented on a diff in pull request #21704: Refactor distsql about shadow related syntax #21696

Posted by GitBox <gi...@apache.org>.
jiangML commented on code in PR #21704:
URL: https://github.com/apache/shardingsphere/pull/21704#discussion_r1003961975


##########
test/parser/src/main/java/org/apache/shardingsphere/test/sql/parser/parameterized/jaxb/cases/domain/statement/distsql/rql/ShowDefaultShadowAlgorithmsStatementTestCase.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.test.sql.parser.parameterized.jaxb.cases.domain.statement.distsql.rql;
+
+import org.apache.shardingsphere.test.sql.parser.parameterized.jaxb.cases.domain.statement.DatabaseContainedTestCase;
+
+/**
+ * Show default shadow algorithm statement test case.
+ */
+public class ShowDefaultShadowAlgorithmsStatementTestCase extends DatabaseContainedTestCase {
+    

Review Comment:
   ok



##########
features/shadow/distsql/parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java:
##########
@@ -173,4 +171,5 @@ public ASTNode visitDatabaseName(final DatabaseNameContext ctx) {
     public ASTNode visitCountShadowRule(final CountShadowRuleContext ctx) {
         return new CountShadowRuleStatement(Objects.nonNull(ctx.databaseName()) ? (DatabaseSegment) visit(ctx.databaseName()) : null);
     }
+    

Review Comment:
   ok



##########
features/shadow/distsql/statement/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/statement/ShowDefaultShadowAlgorithmStatement.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.shadow.distsql.parser.statement;
+
+import lombok.Getter;
+import org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
+
+/**
+ * Show default shadow algorithm statement.
+ */
+@Getter
+public final class ShowDefaultShadowAlgorithmStatement extends ShowRulesStatement {
+    
+    public ShowDefaultShadowAlgorithmStatement(final DatabaseSegment database) {
+        super(database);
+    }
+    

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] RaigorJiang commented on a diff in pull request #21704: Refactor distsql about shadow related syntax #21696

Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on code in PR #21704:
URL: https://github.com/apache/shardingsphere/pull/21704#discussion_r1003085647


##########
features/shadow/distsql/statement/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/statement/ShowDefaultShadowAlgorithmStatement.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.shadow.distsql.parser.statement;
+
+import lombok.Getter;
+import org.apache.shardingsphere.distsql.parser.statement.rql.show.ShowRulesStatement;
+import org.apache.shardingsphere.sql.parser.sql.common.segment.generic.DatabaseSegment;
+
+/**
+ * Show default shadow algorithm statement.
+ */
+@Getter
+public final class ShowDefaultShadowAlgorithmStatement extends ShowRulesStatement {
+    
+    public ShowDefaultShadowAlgorithmStatement(final DatabaseSegment database) {
+        super(database);
+    }
+    

Review Comment:
   Please remove the useless blank line.



##########
features/shadow/distsql/parser/src/main/java/org/apache/shardingsphere/shadow/distsql/parser/core/ShadowDistSQLStatementVisitor.java:
##########
@@ -173,4 +171,5 @@ public ASTNode visitDatabaseName(final DatabaseNameContext ctx) {
     public ASTNode visitCountShadowRule(final CountShadowRuleContext ctx) {
         return new CountShadowRuleStatement(Objects.nonNull(ctx.databaseName()) ? (DatabaseSegment) visit(ctx.databaseName()) : null);
     }
+    

Review Comment:
   Please remove the useless blank line.



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