gianm commented on a change in pull request #7325: Fix result-level cache for 
queries
URL: https://github.com/apache/incubator-druid/pull/7325#discussion_r276422611
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/timeseries/TimeseriesQueryQueryToolChest.java
 ##########
 @@ -274,6 +274,24 @@ public boolean isCacheable(TimeseriesQuery query, boolean 
willMergeRunners)
             .build();
       }
 
+      @Override
+      public byte[] computeResultLevelCacheKey(TimeseriesQuery query)
+      {
+        final CacheKeyBuilder builder = new CacheKeyBuilder(TIMESERIES_QUERY)
+            .appendBoolean(query.isDescending())
+            .appendBoolean(query.isSkipEmptyBuckets())
+            .appendCacheable(query.getGranularity())
+            .appendCacheable(query.getDimensionsFilter())
+            .appendCacheables(query.getAggregatorSpecs())
+            .appendCacheable(query.getVirtualColumns())
+            .appendCacheables(query.getPostAggregatorSpecs())
+            .appendInt(query.getLimit());
+        if (query.isGrandTotal()) {
 
 Review comment:
   This might as well just be `.appendBoolean(query.isGrandTotal())`, and is 
probably better, since there's less of a need to make sure that things we add 
_after_ it will mesh well.

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