Repository navigation
Cherry pick #107915 to 26.5: Fix position-dependent column-wise insert deduplication hash - #107964
Merged
Merged
Conversation
ColumnString::updateHashWithValueRange and ColumnArray::updateHashWithValueRange hashed the absolute cumulative offsets of the row range, so the hash depended on the position of the range within the column. This function computes the column-wise data hash used by the unified insert deduplication path (insert_deduplication_version = new_unified_hash and compatible_double_hashes), so two identical blocks located at different offsets - e.g. repeated rows combined into one async insert flush - produced different deduplication block ids and were not deduplicated. Fixed-width columns were already position-invariant. Hash the boundaries relative to the start of the range instead. For begin == 0 (every single-block insert) the bytes fed to the hash are unchanged, so unified deduplication ids already persisted under compatible_double_hashes stay valid; only the broken multi-offset case changes. Add a unit test (equal String blocks at different offsets) and an integration test (async self-deduplication under new_unified_hash with String and Array columns). Both fail before the fix and pass after. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… byte stream Use the raw-byte SipHash overload for the computed relative offset instead of SipHash::update(UInt64), which endian-normalizes the value on big-endian targets. This keeps the begin == 0 byte stream identical to the previous absolute-offset hashing on all architectures (including s390x), so unified deduplication ids already persisted under compatible_double_hashes stay valid there too. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…pat note The unified deduplication hash is not authoritative until new_unified_hash is the default: under compatible_double_hashes the legacy id (unchanged here) provides deduplication, so the previously-broken unified hashes do not need to be preserved. Use the plain SipHash integer update and a clearer comment instead of the raw-byte overload that was only there for byte-identity. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…se-hash-position Fix position-dependent column-wise insert deduplication hash
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.
Original pull-request #107915
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job