fix: VectorHasher timestamp precision handling in value-id paths - #18598
Open
rui-mo wants to merge 1 commit into
Open
fix: VectorHasher timestamp precision handling in value-id paths#18598rui-mo wants to merge 1 commit into
rui-mo wants to merge 1 commit into
Conversation
✅ Deploy Preview for meta-velox canceled.
|
Selective Build Plan
Affected targets (368)Directly changed (135)
Transitively affected (233)
Fast path • Graph from main@2ca5030f391a |
Yuhta
reviewed
Aug 21, 2026
| return value; | ||
| } | ||
|
|
||
| inline int64_t toInt64(Timestamp timestamp) const { |
Contributor
There was a problem hiding this comment.
Remove this seems no longer used
Contributor
|
@rui-mo thanks for following up on this. Question on this: since now you added support for wide 128 bit integers, could we use that for timestamps - I suppose we could fit the two 64 integers from the timestamp side by side, and not lose any precision? |
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.
Problem
VectorHasher maps timestamps to value ids using millisecond precision. The
direct
valueId(Timestamp)andlookupValueId(Timestamp)paths already rejecttimestamps that cannot be represented losslessly in milliseconds, but the range
fast path and row-wise analyze path could call
toInt64(Timestamp), whichuses
timestamp.toMillis()directly. This could silently map distinct sub-millisecond timestamps to the same millisecond value id while still reporting that
value-id mapping was usable.
Changes
This PR fixes the issue by:
millisecond values.
millisecond check.
VectorHasher::empty()so a hasher that has overflowed distinctvalue tracking is not treated as empty during merge. This is required for
timestamp precision overflow.
Issue related: #18597.