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/08/18 02:51:12 UTC
[GitHub] [shardingsphere] cowboysync opened a new pull request, #20255: Update IntervalShardingAlgorithm.java
cowboysync opened a new pull request, #20255:
URL: https://github.com/apache/shardingsphere/pull/20255
the method private String getDateTimeText(final Comparable<?> endpoint) will throws an java.lang.UnsupportedOperationException if the parameter endpoint's type is java.sql.Date, because of java.sql.Date values do not have a time component, so it's mehtod public Instant toInstant() always throws an java.lang.UnsupportedOperationException.
Reproduction example: examples/shardingsphere-jdbc-example/single-feature-example/sharding-example/sharding-raw-jdbc-example/src/main/java/org/apache/shardingsphere/example/sharding/raw/jdbc/ShardingRawYamlIntervalConfigurationExample.java
Fixes #ISSUSE_ID.
Changes proposed in this pull request:
-
-
-
--
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] linghengqian commented on pull request #20255: Update IntervalShardingAlgorithm.java to fix an exception caused by polymorphism
Posted by GitBox <gi...@apache.org>.
linghengqian commented on PR #20255:
URL: https://github.com/apache/shardingsphere/pull/20255#issuecomment-1241479565
- There are too many commits for this PR, you might open a new issue and submit a new 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] cowboysync commented on a diff in pull request #20255: Update IntervalShardingAlgorithm.java
Posted by GitBox <gi...@apache.org>.
cowboysync commented on code in PR #20255:
URL: https://github.com/apache/shardingsphere/pull/20255#discussion_r956527352
##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java:
##########
@@ -448,4 +448,12 @@ public void assertIntegerInJDBCType() {
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.closed("04", "10")));
assertThat(actualAsMonthString.size(), is(4));
}
+
+ @Test
+ public void assertDateInSqlDate() {
+ Collection<String> actualAsLocalDate = shardingAlgorithmByJDBCDate.doSharding(availableTablesForJDBCDateDataSources,
+ new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO,
+ Range.closed(new Date(2021 - 1900, 6 - 1, 15), new Date(2021 - 1900, 7 - 1, 31))));
Review Comment:
change to use the Java 8 Date Time API to construct java.sql.Date instance
--
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 #20255: Update IntervalShardingAlgorithm.java
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #20255:
URL: https://github.com/apache/shardingsphere/pull/20255#issuecomment-1219365071
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/20255?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 [#20255](https://codecov.io/gh/apache/shardingsphere/pull/20255?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (1c12200) into [master](https://codecov.io/gh/apache/shardingsphere/commit/3b15d53195316122e703b98c0476a4863326732f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (3b15d53) will **increase** coverage by `0.02%`.
> The diff coverage is `64.00%`.
> :exclamation: Current head 1c12200 differs from pull request most recent head 640072f. Consider uploading reports for the commit 640072f to get more accurate results
```diff
@@ Coverage Diff @@
## master #20255 +/- ##
============================================
+ Coverage 60.87% 60.90% +0.02%
Complexity 2422 2422
============================================
Files 3876 3876
Lines 54690 54692 +2
Branches 9310 9311 +1
============================================
+ Hits 33295 33311 +16
+ Misses 18542 18529 -13
+ Partials 2853 2852 -1
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/20255?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...m/sharding/datetime/IntervalShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2RhdGV0aW1lL0ludGVydmFsU2hhcmRpbmdBbGdvcml0aG0uamF2YQ==) | `78.04% <0.00%> (-0.97%)` | :arrow_down: |
| [...gment/expression/impl/ListExpressionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvZXhwcmVzc2lvbi9pbXBsL0xpc3RFeHByZXNzaW9uQ29udmVydGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...epare/datasource/PrepareTargetTablesParameter.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLWRhdGEtcGlwZWxpbmUvc2hhcmRpbmdzcGhlcmUtZGF0YS1waXBlbGluZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYXRhL3BpcGVsaW5lL2NvcmUvcHJlcGFyZS9kYXRhc291cmNlL1ByZXBhcmVUYXJnZXRUYWJsZXNQYXJhbWV0ZXIuamF2YQ==) | `0.00% <ø> (ø)` | |
| [...r/statement/impl/OpenGaussStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1vcGVuZ2F1c3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NxbC9wYXJzZXIvb3BlbmdhdXNzL3Zpc2l0b3Ivc3RhdGVtZW50L2ltcGwvT3BlbkdhdXNzU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `84.76% <71.42%> (+0.49%)` | :arrow_up: |
| [...ssion/impl/BinaryOperationExpressionConverter.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtZmVkZXJhdGlvbi9zaGFyZGluZ3NwaGVyZS1pbmZyYS1mZWRlcmF0aW9uLW9wdGltaXplci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvaW5mcmEvZmVkZXJhdGlvbi9vcHRpbWl6ZXIvY29udmVydGVyL3NlZ21lbnQvZXhwcmVzc2lvbi9pbXBsL0JpbmFyeU9wZXJhdGlvbkV4cHJlc3Npb25Db252ZXJ0ZXIuamF2YQ==) | `97.05% <83.33%> (-2.95%)` | :arrow_down: |
| [.../statement/impl/PostgreSQLStatementSQLVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci9zaGFyZGluZ3NwaGVyZS1zcWwtcGFyc2VyLWRpYWxlY3Qvc2hhcmRpbmdzcGhlcmUtc3FsLXBhcnNlci1wb3N0Z3Jlc3FsL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcWwvcGFyc2VyL3Bvc3RncmVzcWwvdmlzaXRvci9zdGF0ZW1lbnQvaW1wbC9Qb3N0Z3JlU1FMU3RhdGVtZW50U1FMVmlzaXRvci5qYXZh) | `88.05% <85.71%> (+1.02%)` | :arrow_up: |
| [...handler/distsql/ral/hint/enums/HintSourceType.java](https://codecov.io/gh/apache/shardingsphere/pull/20255/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9oYW5kbGVyL2Rpc3RzcWwvcmFsL2hpbnQvZW51bXMvSGludFNvdXJjZVR5cGUuamF2YQ==) | `42.85% <0.00%> (+42.85%)` | :arrow_up: |
: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] linghengqian commented on a diff in pull request #20255: Update IntervalShardingAlgorithm.java
Posted by GitBox <gi...@apache.org>.
linghengqian commented on code in PR #20255:
URL: https://github.com/apache/shardingsphere/pull/20255#discussion_r954543993
##########
shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/IntervalShardingAlgorithmTest.java:
##########
@@ -448,4 +448,12 @@ public void assertIntegerInJDBCType() {
new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO, Range.closed("04", "10")));
assertThat(actualAsMonthString.size(), is(4));
}
+
+ @Test
+ public void assertDateInSqlDate() {
+ Collection<String> actualAsLocalDate = shardingAlgorithmByJDBCDate.doSharding(availableTablesForJDBCDateDataSources,
+ new RangeShardingValue<>("t_order", "create_time", DATA_NODE_INFO,
+ Range.closed(new Date(2021 - 1900, 6 - 1, 15), new Date(2021 - 1900, 7 - 1, 31))));
Review Comment:
Why use a constructor that was deprecated in JDK8? This breaks CI for JDK18.
--
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] cowboysync closed pull request #20255: Update IntervalShardingAlgorithm.java to fix an exception caused by polymorphism
Posted by GitBox <gi...@apache.org>.
cowboysync closed pull request #20255: Update IntervalShardingAlgorithm.java to fix an exception caused by polymorphism
URL: https://github.com/apache/shardingsphere/pull/20255
--
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