linghengqian commented on issue #29353:
URL: 
https://github.com/apache/shardingsphere/issues/29353#issuecomment-1925355894

   @dongzl 
   - To be honest, I don't see what the IntervalShardingAlgorithm side can do, 
and the unit tests added in #29973 show that the sharding spans "normally" 
across different years. I don't understand what parameters are passed in when 
creating some real tables from a logical table.
   ```java
   @Test
       void assertRangeDoShardingByMonthsSpanYears() {
           final IntervalShardingAlgorithm algorithm = 
createAlgorithm("yyyy-MM-dd HH:mm:ss", "2023-01-01 00:00:00",
                   "2024-12-31 23:59:59", "yyyyMM", 1, "Months");
           Collection<String> availableTargetNames = new LinkedList<>();
           for (int i = 2023; i <= 2024; i++) {
               for (int j = 1; j <= 12; j++) {
                   availableTargetNames.add(String.format("t_order_%04d%02d", 
i, j));
               }
           }
           final Collection<String> actual = 
algorithm.doSharding(availableTargetNames, createShardingValue(
                   LocalDateTime.of(2023, 12, 31, 0, 0),
                   LocalDateTime.of(2024, 1, 31, 0, 0)));
           assertThat(actual.size(), is(2));
           assertThat(actual, hasItems("t_order_202401", "t_order_202312"));
       }
   ```
   - It's a pity that I lack relevant background knowledge.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to