fix: use column collation in bloom filter hash to handle non-deterministic collations (#10263) - #10383
Open
waterWang wants to merge 1 commit into
Open
fix: use column collation in bloom filter hash to handle non-deterministic collations (#10263)#10383waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
…istic collations (timescale#10263) The bloom filter hash function batch_metadata_builder_bloom1_calculate_hash hardcoded C_COLLATION_OID for all hash computations. When a column uses a non-deterministic collation (e.g. ICU case-insensitive und-u-ks-level2), collation-equivalent values like 'alice' and 'ALICE' produce different hashes, causing the bloom filter to falsely reject the batch during UPDATE/DELETE on compressed data. Fix: - Add collation_oids array to Bloom1HasherInternal - Pass column collation through bloom1_hasher_init and all callers - Use the actual column collation instead of C_COLLATION_OID in batch_metadata_builder_bloom1_calculate_hash - For scalar types and debug functions, continue using C_COLLATION_OID (no column context available)
|
|
1 similar comment
|
|
|
@antekresic, @natalya-aksman: please review this pull request.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Use the actual column collation in the bloom filter hash function instead of hardcoding
C_COLLATION_OID.Why
Fixes #10263.
The bloom filter hash function
batch_metadata_builder_bloom1_calculate_hashhardcodedC_COLLATION_OIDfor all hash computations. When a column uses a non-deterministic collation (e.g. ICU case-insensitiveund-u-ks-level2), collation-equivalent values like'alice'and'ALICE'produce different hashes, causing the bloom filter to falsely reject the batch during UPDATE/DELETE on compressed data.How
collation_oidsarray toBloom1HasherInternalbloom1_hasher_initand all callersC_COLLATION_OIDinbatch_metadata_builder_bloom1_calculate_hashC_COLLATION_OID(no column context available, and these are non-critical paths)Files changed
tsl/src/compression/batch_metadata_builder.h— function declarationstsl/src/compression/batch_metadata_builder_bloom1.c— core fix + all internal callerstsl/src/compression/compression.c— 2 callerstsl/src/compression/compression_dml.c— 2 callerstsl/src/compression/recompress.c— 1 caller