gianm opened a new issue, #16552:
URL: https://github.com/apache/druid/issues/16552

   The `ResultLevelCachingQueryRunner` does this when it computes the cache key 
for a query:
   
   ```
   final String cacheKeyStr = 
StringUtils.fromUtf8(strategy.computeResultLevelCacheKey(query));
   ```
   
   This is bad because not all byte strings can be represented as Java Strings. 
For example, the byte arrays `[63, -48, 0, 0, 0, 0, 0, 0]` and `[63, -24, 0, 0, 
0, 0, 0, 0]` have the same representation when converted to Strings. Both have 
an invalid second character, which both get mapped to the replacement 
character. These byte arrays are the representations of doubles `0.25` and 
`0.75` respectively, which is how this was originally noticed (two queries had 
a cache key collision when they differed only in that one used `0.25` and one 
used `0.75` as a quantile parameter).
   
   To fix this we need to always use `byte[]`, never `String`, when dealing 
with cache keys.


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

To unsubscribe, e-mail: [email protected]

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