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_r276423008
##########
File path:
processing/src/main/java/org/apache/druid/query/groupby/GroupByQueryQueryToolChest.java
##########
@@ -481,6 +481,30 @@ public boolean isCacheable(GroupByQuery query, boolean
willMergeRunners)
.build();
}
+ @Override
+ public byte[] computeResultLevelCacheKey(GroupByQuery query)
+ {
+ final CacheKeyBuilder builder = new CacheKeyBuilder(GROUPBY_QUERY)
+ .appendByte(CACHE_STRATEGY_VERSION)
+ .appendCacheable(query.getGranularity())
+ .appendCacheable(query.getDimFilter())
+ .appendCacheables(query.getAggregatorSpecs())
+ .appendCacheables(query.getDimensions())
+ .appendCacheable(query.getVirtualColumns())
+ .appendCacheable(query.getHavingSpec())
+ .appendCacheable(query.getLimitSpec());
+
+ if (!query.getPostAggregatorSpecs().isEmpty()) {
Review comment:
Might as well add the post-aggregator specs unconditionally.
----------------------------------------------------------------
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]