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/06/28 04:03:23 UTC
[GitHub] [shardingsphere] jingshanglu opened a new pull request, #18647: fix issue-8551
jingshanglu opened a new pull request, #18647:
URL: https://github.com/apache/shardingsphere/pull/18647
Fixes #8551.
--
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] strongduanmu commented on a diff in pull request #18647: fix issue-8551
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18647:
URL: https://github.com/apache/shardingsphere/pull/18647#discussion_r908134137
##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/route/engine/condition/engine/impl/InsertClauseShardingConditionEngine.java:
##########
@@ -109,6 +112,15 @@ private ShardingCondition createShardingCondition(final String tableName, final
return result;
}
+ private void generateShardingCondition(final CommonExpressionSegment expressionSegment, final ShardingCondition result, final String shardingColumn, final String tableName) {
+ try {
+ Integer value = Integer.valueOf(expressionSegment.getText());
+ result.getValues().add(new ListShardingConditionValue<>(shardingColumn, tableName, Collections.singletonList(value)));
+ } catch (NumberFormatException exception) {
Review Comment:
Please rename exception to ex.
##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/algorithm/sharding/inline/InlineShardingAlgorithm.java:
##########
@@ -67,7 +68,11 @@ private boolean isAllowRangeQuery(final Properties props) {
@Override
public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Comparable<?>> shardingValue) {
Closure<?> closure = createClosure();
- closure.setProperty(shardingValue.getColumnName(), shardingValue.getValue());
+ Comparable<?> value = shardingValue.getValue();
+ if (value instanceof Number) {
+ value = (Comparable<?>) NumberMath.abs((Number) value);
Review Comment:
Can we replace NumberMath.abs with Math.abs?
--
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 #18647: fix issue-8551
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18647:
URL: https://github.com/apache/shardingsphere/pull/18647#issuecomment-1168237006
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18647?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 [#18647](https://codecov.io/gh/apache/shardingsphere/pull/18647?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b19994a) into [master](https://codecov.io/gh/apache/shardingsphere/commit/b5070e7a0e66b8a36967f9d2a77a93a317c37b18?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b5070e7) will **decrease** coverage by `0.01%`.
> The diff coverage is `58.33%`.
```diff
@@ Coverage Diff @@
## master #18647 +/- ##
============================================
- Coverage 59.41% 59.40% -0.02%
Complexity 2259 2259
============================================
Files 3727 3727
Lines 54726 54737 +11
Branches 9313 9315 +2
============================================
- Hits 32516 32515 -1
- Misses 19469 19482 +13
+ Partials 2741 2740 -1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18647?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...gine/impl/InsertClauseShardingConditionEngine.java](https://codecov.io/gh/apache/shardingsphere/pull/18647/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL2NvbmRpdGlvbi9lbmdpbmUvaW1wbC9JbnNlcnRDbGF1c2VTaGFyZGluZ0NvbmRpdGlvbkVuZ2luZS5qYXZh) | `80.95% <50.00%> (-11.78%)` | :arrow_down: |
| [...rithm/sharding/inline/InlineShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/18647/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2lubGluZS9JbmxpbmVTaGFyZGluZ0FsZ29yaXRobS5qYXZh) | `84.00% <75.00%> (-2.37%)` | :arrow_down: |
| [...d/text/distsql/ral/common/hint/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/18647/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: |
| [...ute/engine/condition/ExpressionConditionUtils.java](https://codecov.io/gh/apache/shardingsphere/pull/18647/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL2NvbmRpdGlvbi9FeHByZXNzaW9uQ29uZGl0aW9uVXRpbHMuamF2YQ==) | `50.00% <0.00%> (ø)` | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18647?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/18647?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 [9a49ab8...b19994a](https://codecov.io/gh/apache/shardingsphere/pull/18647?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] strongduanmu merged pull request #18647: fix issue-8551
Posted by GitBox <gi...@apache.org>.
strongduanmu merged PR #18647:
URL: https://github.com/apache/shardingsphere/pull/18647
--
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