clintropolis opened a new pull request #11358:
URL: https://github.com/apache/druid/pull/11358


   ### Description
   This PR fixes an issue where expressions which depend on some external state 
which is also typically encoded into a cache key, such as a lookup, can have 
the incorrect cache key because the expression was only taking into account the 
string form of the expression. This causes incorrect results if the underlying 
lookup has changed, as the cache key did not encode this information and so 
remains unchanged, despite that the expression would result in a different 
value with the newer lookup.
   
   This has been resolved by making `Expr` extend `Cacheable` and providing a 
default `getCacheKey` implementation which uses the stringified form, but is 
overridden by the lookup expression to form a composite key of the stringified 
expression and the lookup extraction functions cache key.
   
   I moved `CacheKeyBuilder` from `druid-processing` to `druid-core`, which was 
marked with `@PublicApi`, so tagging with release notes (`Cacheable` was 
already defined in `druid-core`).
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [x] been tested in a test Druid cluster.
   


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



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

Reply via email to