LakshSingla commented on code in PR #14475:
URL: https://github.com/apache/druid/pull/14475#discussion_r1240365397
##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/util/IntervalUtils.java:
##########
@@ -61,4 +64,20 @@ public static List<Interval> difference(final List<Interval>
list1, final List<I
return retVal;
}
+
+ /**
+ * This method checks if the provided interval is aligned by the granularity
provided and if it occupies exactly
+ * one "unit" of the granularity
+ * Note: ALL granularity isn't aligned to any interval, however this method
is defines that ALL granularity matches
+ * an interval with boundary ({@code DateTimes.MIN}, {@code DateTimes.MAX})
+ */
+ public static boolean doesIntervalMatchesGranularity(final Interval
interval, final Granularity granularity)
Review Comment:
Left a comment on the alternative implementation, which suggests to me that
aligned is probably a misnomer as we want both the following conditions to hold
true:
1. The interval is aligned with the granularity
2. The interval should fit exactly one "unit" of the granularity.
In case that comment holds true, we shouldn't name it `aligned`. I am open
to alternatives as matches isn't very descriptive either 😥
--
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]