Skip to content

InDimFilter: Fix cache key computation to avoid collisions.#11168

Merged
gianm merged 2 commits intoapache:masterfrom
gianm:fix-in-filter-cache-key
Apr 29, 2021
Merged

InDimFilter: Fix cache key computation to avoid collisions.#11168
gianm merged 2 commits intoapache:masterfrom
gianm:fix-in-filter-cache-key

Conversation

@gianm
Copy link
Copy Markdown
Contributor

@gianm gianm commented Apr 27, 2021

The prior code did not include separation between values, and encoded
null ambiguously. This patch fixes both of those issues by encoding
strings as length + value instead of just value.

I think cache key computation was OK prior to #9800. Prior to that
patch, the cache key was computed using CacheKeyBuilder.appendStrings,
which encodes strings as UTF-8 and inserts a separator byte (0xff)
between them that cannot appear in a UTF-8 stream.

The prior code did not include separation between values, and encoded
null ambiguously. This patch fixes both of those issues by encoding
strings as length + value instead of just value.

I think cache key computation was OK prior to apache#9800. Prior to that
patch, the cache key was computed using CacheKeyBuilder.appendStrings,
which encodes strings as UTF-8 and inserts a separator byte (0xff)
between them that cannot appear in a UTF-8 stream.
@jihoonson
Copy link
Copy Markdown
Contributor

Nice catch 👍

@gianm gianm merged commit 7d808e3 into apache:master Apr 29, 2021
@gianm gianm deleted the fix-in-filter-cache-key branch April 29, 2021 00:28
@clintropolis clintropolis added this to the 0.22.0 milestone Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants