Skip to content

Commit

Permalink
Remove redundant UTC check from getInterval().
Browse files Browse the repository at this point in the history
Signed-off-by: Finn Carroll <carrofin@amazon.com>
  • Loading branch information
finnegancarroll committed Jan 16, 2025
1 parent 7ddbe8c commit 2cd9e8e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions server/src/main/java/org/opensearch/common/Rounding.java
Original file line number Diff line number Diff line change
Expand Up @@ -1382,16 +1382,8 @@ public static OptionalLong getInterval(Rounding rounding) {

if (rounding instanceof TimeUnitRounding) {
interval = (((TimeUnitRounding) rounding).unit).extraLocalOffsetLookup();
if (!isUTCTimeZone(((TimeUnitRounding) rounding).timeZone)) {
// Fast filter aggregation cannot be used if it needs time zone rounding
return OptionalLong.empty();
}
} else if (rounding instanceof TimeIntervalRounding) {
interval = ((TimeIntervalRounding) rounding).interval;
if (!isUTCTimeZone(((TimeIntervalRounding) rounding).timeZone)) {
// Fast filter aggregation cannot be used if it needs time zone rounding
return OptionalLong.empty();
}
} else {
return OptionalLong.empty();
}
Expand Down

0 comments on commit 2cd9e8e

Please sign in to comment.