github-actions[bot] commented on code in PR #65219:
URL: https://github.com/apache/doris/pull/65219#discussion_r3533037791
##########
fe/fe-core/src/test/java/org/apache/doris/catalog/DynamicPartitionTableTest.java:
##########
@@ -2165,7 +2181,56 @@ public void testTimeStampTzDynamicPartitionWeekUnit()
throws Exception {
Range<PartitionKey> range = item.getItems();
Assert.assertTrue("lower must be < upper",
range.lowerEndpoint().compareTo(range.upperEndpoint())
< 0);
+
+ // Partition boundaries must be at UTC midnight (hour=00)
+ // regardless of time_zone.
+ List<LiteralExpr> lowerKeys = range.lowerEndpoint().getKeys();
+ Assert.assertEquals(1, lowerKeys.size());
+ String lowerStr = lowerKeys.get(0).getStringValue();
+ Assert.assertTrue("Lower key must be UTC with +00:00 suffix: "
+ lowerStr,
+ lowerStr.contains("+00:00"));
+
+ List<LiteralExpr> upperKeys = range.upperEndpoint().getKeys();
+ Assert.assertEquals(1, upperKeys.size());
+ String upperStr = upperKeys.get(0).getStringValue();
+ Assert.assertTrue("Upper key must be UTC with +00:00 suffix: "
+ upperStr,
+ upperStr.contains("+00:00"));
+
+ // UTC midnight (00:00), regardless of time_zone.
+ String lowerHour = lowerStr.substring(11, 13);
+ Assert.assertEquals("Lower bound must be UTC midnight (00): "
+ lowerStr,
+ "00", lowerHour);
+ String upperHour = upperStr.substring(11, 13);
+ Assert.assertEquals("Upper bound must be UTC midnight (00): "
+ upperStr,
+ "00", upperHour);
Review Comment:
This still computes the expected weekly partition name from `utcNow`, but
the scheduler does not name WEEK partitions from the raw current date.
`getAddPartitionOp()` uses `prevBorderForName`, and
`DynamicPartitionUtil.getPartitionRangeOfWeek()` first moves `idx=0` to the
configured week start date before `getFormattedPartitionName()` formats the
name. This is distinct from the earlier second-clock-sample race: even for one
fixed instant, around a UTC year boundary this can reject the correct output.
For example, at `2027-01-01 UTC`, the current week lower border is
`2026-12-28`, so the scheduler creates `p2026_53`, while this assertion only
accepts `p2027_01` or `p2026_52`. Please derive the expected name from the
generated current partition lower bound, or call the same
`getPartitionRangeString`/`getFormattedPartitionName` path used by the
scheduler.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]