kfaraz commented on code in PR #19690:
URL: https://github.com/apache/druid/pull/19690#discussion_r3588155426


##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataQuery.java:
##########
@@ -1065,20 +1065,40 @@ public List<Interval> retrieveUnusedSegmentIntervals(
   }
 
   /**
-   * Gets unused segment intervals for the specified datasource. There is no
-   * guarantee on the order of intervals in the list or on whether the limited
-   * list contains the earliest or latest intervals present in the datasource.
+   * Gets unused segment intervals for the specified datasource.
+   * <p>
+   * Note: This method does NOT guarantee that:
+   * <ul>
+   * <li>the intervals in the result would be ordered</li>
+   * <li>the result would contain the earliest or latest intervals for this 
datasource</li>
+   * <li>it would scan all unused segments for this datasource. So, the result
+   * may contain less than {@code limit} entries even when there are more 
distinct
+   * unused segment intervals in the metadata store for this datasource.</li>
+   * </ul>
    *
    * @return List of unused segment intervals containing upto {@code limit} 
interval entries.
    */
   public List<Interval> retrieveUnusedSegmentIntervals(String dataSource, int 
limit)
   {
     final String sql = StringUtils.format(
-        "SELECT start, %2$send%2$s FROM %1$s"
-        + " WHERE dataSource = :dataSource AND used = false"
-        + " GROUP BY %2$send%2$s, start"
-        + "  %3$s",
-        dbTables.getSegmentsTable(), connector.getQuoteString(), 
connector.limitClause(limit)
+        // Text blocks are not supported in the current checkstyle version

Review Comment:
   Yes, it is one of the custom rules. I will try to update it in a later PR.
   Thanks for calling this out, I will fix the comment.



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