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_r275016341
##########
File path:
processing/src/main/java/org/apache/druid/query/groupby/having/GreaterThanHavingSpec.java
##########
@@ -119,4 +122,15 @@ public String toString()
sb.append('}');
return sb.toString();
}
+
+ @Override
+ public byte[] getCacheKey()
+ {
+ return new CacheKeyBuilder(HavingSpecUtil.CACHE_TYPE_ID_GREATER_THAN)
+ .appendString(aggregationName)
+ .appendByteArray(StringUtils.toUtf8(String.valueOf(value)))
+ .appendStrings(aggregators.keySet())
+ .appendCacheables(aggregators.values())
Review comment:
You don't need to add them to the cache key -- only the `aggregation` and
`value` matter. The idea is that anything that changes the meaning or effect of
the operator should be part of the cache key, but not other stuff.
`aggregators` is just some extra information that the HavingSpec uses to do its
job.
----------------------------------------------------------------
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]