LakshSingla commented on code in PR #14475:
URL: https://github.com/apache/druid/pull/14475#discussion_r1242066532


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/util/IntervalUtils.java:
##########
@@ -61,4 +64,23 @@ 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 
or is an instance of {@link Intervals#ETERNITY}
+   * 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})
+   * This is used to check if the granularity allocation made by the overlord 
is the same as the one requested in the
+   * SQL query
+   */
+  public static boolean isEternityOrDoesIntervalAlignWithGranularity(
+      final Interval interval,
+      final Granularity granularity
+  )
+  {
+    // AllGranularity needs special handling since AllGranularity#bucketStart 
always returns false

Review Comment:
   I was not confident if that would break any pre-existing logic. Also, 
Javadoc states:
   ```



-- 
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]

Reply via email to