Skip to content

Conversation

@linrrzqqq
Copy link
Contributor

pick: #57180

1. alias `xxhash3_64` for `xxhash_64`

2. Support function `murmur_hash3_64_v2`
Before:
```text
mysql> SELECT MURMUR_HASH3_64('1000209601_1756808272');
+------------------------------------------+
| MURMUR_HASH3_64('1000209601_1756808272') |
+------------------------------------------+
|                      1680830166030441144 |
+------------------------------------------+
```
This result differs from the return value of directly calling
mmh3.hash64 in other languages, because external APIs all use mmh3_128
for calculation and then truncate the first 64 bits. The 64-bit version
inside Doris compared to the 128-bit version lacks an h2 register (the
64-bit version only has h1), which will affect the final mixing
calculation of h1 and h2 in the algorithm, leading to issues in the
result.

After support:
```text
mysql> SELECT MURMUR_HASH3_64_V2('1000209601_1756808272');
+---------------------------------------------+
| MURMUR_HASH3_64_V2('1000209601_1756808272') |
+---------------------------------------------+
|                         4038800892574899471 |
+---------------------------------------------+
```

The result now is completely the same as the API call.
@linrrzqqq linrrzqqq requested a review from lide-reed as a code owner November 10, 2025 18:26
@Thearas
Copy link
Contributor

Thearas commented Nov 10, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@linrrzqqq
Copy link
Contributor Author

run buildall

@linrrzqqq linrrzqqq closed this Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants