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/09/03 02:17:17 UTC
[GitHub] [shardingsphere] soulasuna opened a new pull request #12186: Complete insert statement
soulasuna opened a new pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186
Complete insert statement
For #11661
Changes proposed in this pull request:
- Add shadow statement validator.
- Optimize the xml configuration tag name.
- Add future shadow example.
--
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] soulasuna commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701692094
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/shadow/spring/namespace/mybatis/domain/OrderInfo.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.example.shadow.spring.namespace.mybatis.domain;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public final class OrderInfo implements Serializable {
+
Review comment:
I will add serialVersionUID.
--
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] soulasuna commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701698662
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/resources/META-INF/mappers/ShadowMapper.xml
##########
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
Review comment:
This format is consistent with the style of the entire example.
--
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] taojintianxia commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701692808
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/resources/META-INF/mappers/ShadowMapper.xml
##########
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
Review comment:
why there is a whitespace "UTF-8" ?
--
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 #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#issuecomment-912322826
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12186?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 [#12186](https://codecov.io/gh/apache/shardingsphere/pull/12186?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4261f8f) into [master](https://codecov.io/gh/apache/shardingsphere/commit/1301a41807eda152b17ef78fe084bc2d4e9d368e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1301a41) will **decrease** coverage by `0.04%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/12186/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/12186?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 #12186 +/- ##
============================================
- Coverage 63.73% 63.69% -0.05%
- Complexity 1258 1259 +1
============================================
Files 2327 2330 +3
Lines 35413 35445 +32
Branches 6161 6169 +8
============================================
+ Hits 22570 22576 +6
- Misses 11029 11050 +21
- Partials 1814 1819 +5
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/shardingsphere/shadow/route/ShadowSQLRouter.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvU2hhZG93U1FMUm91dGVyLmphdmE=) | `81.63% <0.00%> (-7.26%)` | :arrow_down: |
| [...ine/validator/ShadowStatementValidatorFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS92YWxpZGF0b3IvU2hhZG93U3RhdGVtZW50VmFsaWRhdG9yRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [.../validator/dml/ShadowInsertStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS92YWxpZGF0b3IvZG1sL1NoYWRvd0luc2VydFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...engine/dml/ShadowInsertStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93SW5zZXJ0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `71.42% <50.00%> (-17.47%)` | :arrow_down: |
| [...ner/algorithm/ColumnShadowAlgorithmDeterminer.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL2FsZ29yaXRobS9Db2x1bW5TaGFkb3dBbGdvcml0aG1EZXRlcm1pbmVyLmphdmE=) | `90.00% <87.50%> (+3.04%)` | :arrow_up: |
| [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9oaW50L0hpbnRTb3VyY2VUeXBlLmphdmE=) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
| [...ster/governance/registry/cache/node/CacheNode.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9nb3Zlcm5hbmNlL3JlZ2lzdHJ5L2NhY2hlL25vZGUvQ2FjaGVOb2RlLmphdmE=) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
| [...ter/governance/registry/state/node/StatesNode.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9nb3Zlcm5hbmNlL3JlZ2lzdHJ5L3N0YXRlL25vZGUvU3RhdGVzTm9kZS5qYXZh) | `72.22% <0.00%> (-6.95%)` | :arrow_down: |
| [...re/agent/core/plugin/PluginBootServiceManager.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvY29yZS9wbHVnaW4vUGx1Z2luQm9vdFNlcnZpY2VNYW5hZ2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...sphere/proxy/initializer/BootstrapInitializer.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9pbml0aWFsaXplci9Cb290c3RyYXBJbml0aWFsaXplci5qYXZh) | `0.00% <0.00%> (ø)` | |
| ... and [17 more](https://codecov.io/gh/apache/shardingsphere/pull/12186/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/12186?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/12186?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 [1301a41...4261f8f](https://codecov.io/gh/apache/shardingsphere/pull/12186?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 a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701575952
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/shadow/spring/namespace/mybatis/ShadowSpringNamespaceMybatisExample.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.example.shadow.spring.namespace.mybatis;
+
+import org.apache.shardingsphere.example.shadow.spring.namespace.mybatis.service.ShadowService;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+
+public class ShadowSpringNamespaceMybatisExample {
Review comment:
final one?
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/algorithm/ColumnShadowAlgorithmDeterminer.java
##########
@@ -41,22 +42,22 @@
@Override
public boolean isShadow(final InsertStatementContext insertStatementContext, final Collection<String> relatedShadowTables, final String tableName) {
Collection<String> columnNames = insertStatementContext.getInsertColumnNames();
- List<List<Object>> groupedParameters = insertStatementContext.getGroupedParameters();
Iterator<String> columnNamesIt = columnNames.iterator();
- Iterator<List<Object>> groupedParametersIt = groupedParameters.iterator();
- int count = Math.min(columnNames.size(), groupedParameters.size());
- for (int i = 0; i < count; i++) {
- Optional<Collection<PreciseColumnShadowValue<Comparable<?>>>> preciseColumnShadowValues = getPreciseColumnShadowValues(columnNamesIt.next(), groupedParametersIt.next(), tableName);
- if (preciseColumnShadowValues.isPresent()) {
- if (isPassColumn(preciseColumnShadowValues.get(), columnShadowAlgorithm, relatedShadowTables)) {
+ final List<InsertValueContext> insertValueContexts = insertStatementContext.getInsertValueContexts();
Review comment:
Why is a final definition needed?
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/pom.xml
##########
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>future-shadow-example</artifactId>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <version>5.0.0-RC1-SNAPSHOT</version>
+ </parent>
+ <artifactId>future-shadow-spring-namespace-mybatis-example</artifactId>
+ <name>${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <artifactId>example-spring-mybatis</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Review comment:
Here a new line needs
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/pom.xml
##########
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <artifactId>other-feature-example</artifactId>
+ <version>5.0.0-RC1-SNAPSHOT</version>
+ </parent>
+ <artifactId>future-shadow-example</artifactId>
+ <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
+
+ <modules>
+ <module>future-shadow-spring-namespace-mybatis-example</module>
+ </modules>
+</project>
Review comment:
Here a new line needs.
--
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] soulasuna commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701587411
##########
File path: shardingsphere-features/shardingsphere-shadow/shardingsphere-shadow-core/src/main/java/org/apache/shardingsphere/shadow/route/future/engine/determiner/algorithm/ColumnShadowAlgorithmDeterminer.java
##########
@@ -41,22 +42,22 @@
@Override
public boolean isShadow(final InsertStatementContext insertStatementContext, final Collection<String> relatedShadowTables, final String tableName) {
Collection<String> columnNames = insertStatementContext.getInsertColumnNames();
- List<List<Object>> groupedParameters = insertStatementContext.getGroupedParameters();
Iterator<String> columnNamesIt = columnNames.iterator();
- Iterator<List<Object>> groupedParametersIt = groupedParameters.iterator();
- int count = Math.min(columnNames.size(), groupedParameters.size());
- for (int i = 0; i < count; i++) {
- Optional<Collection<PreciseColumnShadowValue<Comparable<?>>>> preciseColumnShadowValues = getPreciseColumnShadowValues(columnNamesIt.next(), groupedParametersIt.next(), tableName);
- if (preciseColumnShadowValues.isPresent()) {
- if (isPassColumn(preciseColumnShadowValues.get(), columnShadowAlgorithm, relatedShadowTables)) {
+ final List<InsertValueContext> insertValueContexts = insertStatementContext.getInsertValueContexts();
Review comment:
I will fix it.
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/pom.xml
##########
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>future-shadow-example</artifactId>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <version>5.0.0-RC1-SNAPSHOT</version>
+ </parent>
+ <artifactId>future-shadow-spring-namespace-mybatis-example</artifactId>
+ <name>${project.artifactId}</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <artifactId>example-spring-mybatis</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shardingsphere</groupId>
+ <artifactId>shardingsphere-jdbc-core-spring-namespace</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Review comment:
I will fix 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] tristaZero merged pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186
--
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] soulasuna commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701587050
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/pom.xml
##########
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.shardingsphere.example</groupId>
+ <artifactId>other-feature-example</artifactId>
+ <version>5.0.0-RC1-SNAPSHOT</version>
+ </parent>
+ <artifactId>future-shadow-example</artifactId>
+ <packaging>pom</packaging>
+ <name>${project.artifactId}</name>
+
+ <modules>
+ <module>future-shadow-spring-namespace-mybatis-example</module>
+ </modules>
+</project>
Review comment:
I will fix 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 commented on pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#issuecomment-912322826
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12186?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 [#12186](https://codecov.io/gh/apache/shardingsphere/pull/12186?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4d249b4) into [master](https://codecov.io/gh/apache/shardingsphere/commit/1301a41807eda152b17ef78fe084bc2d4e9d368e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1301a41) will **decrease** coverage by `0.03%`.
> The diff coverage is `50.00%`.
[![Impacted file tree graph](https://codecov.io/gh/apache/shardingsphere/pull/12186/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/12186?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 #12186 +/- ##
============================================
- Coverage 63.73% 63.69% -0.04%
Complexity 1258 1258
============================================
Files 2327 2329 +2
Lines 35413 35444 +31
Branches 6161 6168 +7
============================================
+ Hits 22570 22577 +7
- Misses 11029 11050 +21
- Partials 1814 1817 +3
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...e/shardingsphere/shadow/route/ShadowSQLRouter.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvU2hhZG93U1FMUm91dGVyLmphdmE=) | `81.63% <0.00%> (-7.26%)` | :arrow_down: |
| [...ine/validator/ShadowStatementValidatorFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS92YWxpZGF0b3IvU2hhZG93U3RhdGVtZW50VmFsaWRhdG9yRmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
| [.../validator/dml/ShadowInsertStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS92YWxpZGF0b3IvZG1sL1NoYWRvd0luc2VydFN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...engine/dml/ShadowInsertStatementRoutingEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kbWwvU2hhZG93SW5zZXJ0U3RhdGVtZW50Um91dGluZ0VuZ2luZS5qYXZh) | `71.42% <50.00%> (-17.47%)` | :arrow_down: |
| [...ner/algorithm/ColumnShadowAlgorithmDeterminer.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhZG93L3NoYXJkaW5nc3BoZXJlLXNoYWRvdy1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFkb3cvcm91dGUvZnV0dXJlL2VuZ2luZS9kZXRlcm1pbmVyL2FsZ29yaXRobS9Db2x1bW5TaGFkb3dBbGdvcml0aG1EZXRlcm1pbmVyLmphdmE=) | `90.00% <87.50%> (+3.04%)` | :arrow_up: |
| [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9oaW50L0hpbnRTb3VyY2VUeXBlLmphdmE=) | `0.00% <0.00%> (-42.86%)` | :arrow_down: |
| [...re/agent/core/plugin/PluginBootServiceManager.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvY29yZS9wbHVnaW4vUGx1Z2luQm9vdFNlcnZpY2VNYW5hZ2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...sphere/proxy/initializer/BootstrapInitializer.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYm9vdHN0cmFwL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9wcm94eS9pbml0aWFsaXplci9Cb290c3RyYXBJbml0aWFsaXplci5qYXZh) | `0.00% <0.00%> (ø)` | |
| [...agent/core/config/yaml/YamlAgentConfiguration.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtYWdlbnQvc2hhcmRpbmdzcGhlcmUtYWdlbnQtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvYWdlbnQvY29yZS9jb25maWcveWFtbC9ZYW1sQWdlbnRDb25maWd1cmF0aW9uLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...optimize/core/metadata/FederateSchemaMetadata.java](https://codecov.io/gh/apache/shardingsphere/pull/12186/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtb3B0aW1pemUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2luZnJhL29wdGltaXplL2NvcmUvbWV0YWRhdGEvRmVkZXJhdGVTY2hlbWFNZXRhZGF0YS5qYXZh) | `100.00% <0.00%> (ø)` | |
| ... and [9 more](https://codecov.io/gh/apache/shardingsphere/pull/12186/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/12186?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/12186?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 [1301a41...4d249b4](https://codecov.io/gh/apache/shardingsphere/pull/12186?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] soulasuna commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701586978
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/shadow/spring/namespace/mybatis/ShadowSpringNamespaceMybatisExample.java
##########
@@ -0,0 +1,38 @@
+/*
+ * 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.example.shadow.spring.namespace.mybatis;
+
+import org.apache.shardingsphere.example.shadow.spring.namespace.mybatis.service.ShadowService;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+
+public class ShadowSpringNamespaceMybatisExample {
Review comment:
I will fix 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] taojintianxia commented on a change in pull request #12186: Complete insert statement
Posted by GitBox <gi...@apache.org>.
taojintianxia commented on a change in pull request #12186:
URL: https://github.com/apache/shardingsphere/pull/12186#discussion_r701688748
##########
File path: examples/shardingsphere-jdbc-example/other-feature-example/future-shadow-example/future-shadow-spring-namespace-mybatis-example/src/main/java/org/apache/shardingsphere/example/shadow/spring/namespace/mybatis/domain/OrderInfo.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.example.shadow.spring.namespace.mybatis.domain;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public final class OrderInfo implements Serializable {
+
Review comment:
why not add a serialVersionUID ?
--
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