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/01/27 15:13:23 UTC

[GitHub] [shardingsphere] totalo commented on a change in pull request #15131: Enhanced timestamp format handling in AutoIntervalShardingAlgorithm

totalo commented on a change in pull request #15131:
URL: https://github.com/apache/shardingsphere/pull/15131#discussion_r793707691



##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/test/java/org/apache/shardingsphere/sharding/algorithm/sharding/datetime/AutoIntervalShardingAlgorithmTest.java
##########
@@ -119,4 +119,40 @@ public void assertRangeDoShardingWithGreaterTenTables() {
         Collection<String> actual = shardingAlgorithm.doSharding(availableTargetNames, new RangeShardingValue<>("t_order", "create_time", Range.closed("2020-01-01 00:00:00", "2020-01-01 00:00:10")));
         assertThat(actual.size(), is(11));
     }
+
+    @Test
+    public void assertRangeDoShardingInValueWithMilliseconds() {
+        AutoIntervalShardingAlgorithm shardingAlgorithm = new AutoIntervalShardingAlgorithm();
+        shardingAlgorithm.getProps().setProperty("datetime-lower", "2020-01-01 00:00:00");
+        shardingAlgorithm.getProps().setProperty("datetime-upper", "2020-01-01 00:00:30");
+        shardingAlgorithm.getProps().setProperty("sharding-seconds", "1");
+        shardingAlgorithm.init();
+        List<String> availableTargetNames = new LinkedList<>();
+        for (int i = 0; i < 32; i++) {

Review comment:
       I think it's acceptable and doesn't need to be changed.




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