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_r276423109
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/query/topn/TopNQueryQueryToolChest.java
 ##########
 @@ -326,6 +326,25 @@ public boolean isCacheable(TopNQuery query, boolean 
willMergeRunners)
         return builder.build();
       }
 
+      @Override
+      public byte[] computeResultLevelCacheKey(TopNQuery query)
+      {
+        final CacheKeyBuilder builder = new CacheKeyBuilder(TOPN_QUERY)
+            .appendCacheable(query.getDimensionSpec())
+            .appendCacheable(query.getTopNMetricSpec())
+            .appendInt(query.getThreshold())
+            .appendCacheable(query.getGranularity())
+            .appendCacheable(query.getDimensionsFilter())
+            .appendCacheables(query.getAggregatorSpecs())
+            .appendCacheable(query.getVirtualColumns());
+
+        final List<PostAggregator> postAggregators = 
query.getPostAggregatorSpecs();
+        if (!postAggregators.isEmpty()) {
 
 Review comment:
   Might as well add the post-aggregator specs unconditionally here, too.

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