mirror of https://github.com/apache/druid.git
fix end of month bug in PeriodDropRule as well
This commit is contained in:
parent
0543322c56
commit
a9b8d8f1ce
|
@ -56,7 +56,7 @@ public class PeriodDropRule extends DropRule
|
|||
@Override
|
||||
public boolean appliesTo(DataSegment segment, DateTime referenceTimestamp)
|
||||
{
|
||||
final Interval currInterval = new Interval(referenceTimestamp.minus(period), period);
|
||||
final Interval currInterval = new Interval(period, referenceTimestamp);
|
||||
return currInterval.contains(segment.getInterval());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,6 +79,13 @@ public class PeriodDropRuleTest
|
|||
now
|
||||
)
|
||||
);
|
||||
Assert.assertTrue(
|
||||
rule.appliesTo(
|
||||
builder.interval(new Interval(now.minusDays(1), now))
|
||||
.build(),
|
||||
now
|
||||
)
|
||||
);
|
||||
Assert.assertFalse(
|
||||
rule.appliesTo(
|
||||
builder.interval(new Interval(now.minusYears(1), now.minusDays(1)))
|
||||
|
|
Loading…
Reference in New Issue