jihoonson commented on a change in pull request #5471: Implement force push 
down for nested group by query
URL: https://github.com/apache/incubator-druid/pull/5471#discussion_r204904422
 
 

 ##########
 File path: processing/src/main/java/io/druid/query/BaseQuery.java
 ##########
 @@ -257,4 +257,17 @@ public int hashCode()
 
     return Objects.hash(dataSource, descending, context, querySegmentSpec, 
duration, granularity);
   }
+
+  /**
+   * @param query
+   *
+   * @return intervals to query. For nested queries, return the intervals for 
the inner most query.
+   */
+  public static List<Interval> getIntervals(BaseQuery query)
 
 Review comment:
   Since every query implementation extends `BaseQuery`, I think it's better to 
add this method to `Query` which is the higher interface than `BaseQuery`. What 
do you think about adding a method to `Query` like below:
   
   ```java
   default List<Interval> getIntervalsOfInnerMostQuery()
     {
       if (getDataSource() instanceof QueryDataSource) {
         //noinspection unchecked
         return ((QueryDataSource) 
getDataSource()).getQuery().getIntervalsOfInnerMostQuery();
       } else {
         return getIntervals();
       }
     }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to