This is an automated email from the ASF dual-hosted git repository.
lihaopeng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new 09fc1390251 [Feature](func) Support function mmh64_v2 (#2993)
09fc1390251 is described below
commit 09fc13902511b8f239ee9137c7afbb16096315df
Author: linrrarity <[email protected]>
AuthorDate: Mon Oct 27 02:26:23 2025 +0800
[Feature](func) Support function mmh64_v2 (#2993)
## Versions
- [x] dev
- [x] 3.x
- [ ] 2.1
- [ ] 2.0
## Languages
- [x] Chinese
- [x] English
## Docs Checklist
- [ ] Checked by AI
- [ ] Test Cases Built
---
.../encrypt-digest-functions/murmur-hash3-64-v2.md | 46 ++++++++++++++++++++++
.../encrypt-digest-functions/murmur-hash3-64.md | 4 +-
.../encrypt-digest-functions/xxhash-64.md | 4 ++
.../murmur-hash3-64-v2.md} | 12 +++---
.../encrypt-digest-functions/murmur-hash3-64.md | 4 ++
.../encrypt-digest-functions/xxhash-64.md | 4 ++
.../{murmur-hash3-64.md => murmur-hash3-64-v2.md} | 12 +++---
.../encrypt-digest-functions/murmur-hash3-64.md | 4 +-
.../encrypt-digest-functions/xxhash-64.md | 4 ++
sidebars.json | 1 +
.../encrypt-digest-functions/murmur-hash3-64-v2.md | 46 ++++++++++++++++++++++
.../encrypt-digest-functions/murmur-hash3-64.md | 4 +-
.../encrypt-digest-functions/xxhash-64.md | 4 ++
versioned_sidebars/version-3.x-sidebars.json | 1 +
14 files changed, 137 insertions(+), 13 deletions(-)
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
new file mode 100644
index 00000000000..cbff6d7db37
--- /dev/null
+++
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
@@ -0,0 +1,46 @@
+---
+{
+ "title": "MURMUR_HASH3_64_V2",
+ "language": "en"
+}
+---
+
+## Description
+
+Computes a 64-bit MurmurHash3 hash value.
+
+The difference from `MURMUR_HASH3_64` is: this version reuses the 128-bit
processing function of MurmurHash3, outputting only the first 64-bit hash
value, which is consistent with the [standard
library](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)
implementation.
+
+Note: According to testing, the performance of `xxhash_64` is approximately 2
times that of `murmur_hash3_64`. Therefore, when calculating hash values, it is
recommended to use `xxhash_64` instead of `murmur_hash3_64`.
+
+## Syntax
+
+```sql
+MURMUR_HASH3_64_V2( <str> [ , <str> ... ] )
+```
+
+## Parameters
+
+| Parameter | Description |
+| --------- | ----------------------------------------------------- |
+| `<str>` | The value to be computed as a 64-bit MurmurHash3 hash |
+
+## Return Value
+
+Returns the 64-bit MurmurHash3 hash value of the input string.
+
+Returns NULL if any parameter is NULL.
+
+## Examples
+
+```sql
+select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"),
murmur_hash3_64_v2("hello", "world");
+```
+
+```text
++--------------------------+-----------------------------+--------------------------------------+
+| murmur_hash3_64_v2(null) | murmur_hash3_64_v2("hello") |
murmur_hash3_64_v2("hello", "world") |
++--------------------------+-----------------------------+--------------------------------------+
+| NULL | -3758069500696749310 |
-662943091231200135 |
++--------------------------+-----------------------------+--------------------------------------+
+```
\ No newline at end of file
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
index a8e9257f91d..2ed040dadbe 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
@@ -9,6 +9,8 @@
Calculate 64-bit murmur3 hash value
+The difference from `MURMUR_HASH3_64_V2` is: This version is specifically
optimized for 64-bit output, with slightly better performance than the v2
version, but is inconsistent with the [standard
library](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)
implementation.
+
-Note: After testing, the performance of `xxhash_64` is about twice that of
`murmur_hash3_64`, so when calculating hash values, it is recommended to use
`xxhash_64` instead of `murmur_hash3_64`.
@@ -28,7 +30,7 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
Returns the 64-bit murmur3 hash of the input string.
-
+Returns NULL if any parameter input is NULL.
## Examples
diff --git
a/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
index 6f90b6caf3f..25a213f645d 100644
---
a/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
+++
b/docs/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
@@ -11,6 +11,10 @@ Calculates the 64-bit xxhash value of the input string or
binary.
-Note: After testing, the performance of `xxhash_64` is about twice that of
`murmur_hash3_64`, so when calculating hash values, it is recommended to use
`xxhash_64` instead of `murmur_hash3_64`.
+## Alias
+
+- `XXHASH3_64`
+
## Syntax
```sql
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
similarity index 58%
copy from
i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
copy to
i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
index 1ad6c58d22c..e8b6c0de43e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
@@ -1,6 +1,6 @@
---
{
- "title": "MURMUR_HASH3_64",
+ "title": "MURMUR_HASH3_64_V2",
"language": "zh-CN"
}
---
@@ -9,12 +9,14 @@
计算 64 位 murmur3 hash 值
--注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
+与`MURMUR_HASH3_64`的区别是:此版本复用 MurmurHash3 的 128 位处理函数,仅输出第一个 64
位哈希值,与[标准库](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)的行为保持一致。
+
+-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64_v2 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。如需更优的 64 位 MurmurHash3 性能,可考虑使用
`murmur_hash3_64`。
## 语法
```sql
-MURMUR_HASH3_64( <str> [ , <str> ... ] )
+MURMUR_HASH3_64_V2( <str> [ , <str> ... ] )
```
## 参数
@@ -27,12 +29,12 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
返回输入字符串的 64 位 murmur3 hash 值。
-
+任一参数为 NULL 时返回 NULL
## 示例
```sql
-select murmur_hash3_64(null), murmur_hash3_64("hello"),
murmur_hash3_64("hello", "world");
+select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"),
murmur_hash3_64_v2("hello", "world");
```
```text
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
index ef510773fb1..6d36cd05916 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
@@ -9,6 +9,8 @@
计算 64 位 murmur3 hash 值
+与`MURMUR_HASH3_64_V2`的区别是:此版本专门为 64 位输出优化,性能略优于 v2 版本,
但与[标准库](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)实现不一致。
+
-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
## 语法
@@ -27,6 +29,8 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
返回输入字符串的 64 位 murmur3 hash 值。
+任一参数输入为 NULL 时返回 NULL。
+
## 示例
```sql
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
index 38bda3bf103..97a2ab78a0e 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
@@ -11,6 +11,10 @@
-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
+## 别名
+
+- `XXHASH3_64`
+
## 语法
```sql
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
similarity index 61%
copy from
i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
copy to
i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
index 1ad6c58d22c..1009b91f875 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
@@ -1,6 +1,6 @@
---
{
- "title": "MURMUR_HASH3_64",
+ "title": "MURMUR_HASH3_64_V2",
"language": "zh-CN"
}
---
@@ -9,12 +9,14 @@
计算 64 位 murmur3 hash 值
--注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
+与`MURMUR_HASH3_64`的区别是:此版本复用 MurmurHash3 的 128 位处理函数,仅输出第一个 64
位哈希值,与[标准库](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)的行为保持一致。
+
+-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64_v2 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
## 语法
```sql
-MURMUR_HASH3_64( <str> [ , <str> ... ] )
+MURMUR_HASH3_64_V2( <str> [ , <str> ... ] )
```
## 参数
@@ -27,12 +29,12 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
返回输入字符串的 64 位 murmur3 hash 值。
-
+任一参数为 NULL 时返回 NULL
## 示例
```sql
-select murmur_hash3_64(null), murmur_hash3_64("hello"),
murmur_hash3_64("hello", "world");
+select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"),
murmur_hash3_64_v2("hello", "world");
```
```text
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
index 1ad6c58d22c..6d36cd05916 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
@@ -9,6 +9,8 @@
计算 64 位 murmur3 hash 值
+与`MURMUR_HASH3_64_V2`的区别是:此版本专门为 64 位输出优化,性能略优于 v2 版本,
但与[标准库](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)实现不一致。
+
-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
## 语法
@@ -27,7 +29,7 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
返回输入字符串的 64 位 murmur3 hash 值。
-
+任一参数输入为 NULL 时返回 NULL。
## 示例
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
index b3300a397fe..fc6af7d0acd 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
@@ -11,6 +11,10 @@
-注:经过测试 xxhash_64 的性能大约是 murmur_hash3_64 的 2 倍,所以在计算 hash
值时,更推荐使用`xxhash_64`,而不是`murmur_hash3_64`。
+## 别名
+
+- `XXHASH3_64`
+
## 语法
```sql
diff --git a/sidebars.json b/sidebars.json
index 090e96b436d..4879d5fa087 100644
--- a/sidebars.json
+++ b/sidebars.json
@@ -1501,6 +1501,7 @@
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/md5sum",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-32",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64",
+
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sha",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sha2",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sm3",
diff --git
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
new file mode 100644
index 00000000000..0a110c525b5
--- /dev/null
+++
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md
@@ -0,0 +1,46 @@
+---
+{
+ "title": "MURMUR_HASH3_64_V2",
+ "language": "en"
+}
+---
+
+## Description
+
+Computes a 64-bit MurmurHash3 hash value.
+
+The difference from `MURMUR_HASH3_64` is: this version reuses the 128-bit
processing function of MurmurHash3, outputting only the first 64-bit hash
value, which is consistent with the [standard
library](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)
implementation.
+
+Note: According to testing, the performance of `xxhash_64` is approximately 2
times that of `murmur_hash3_64`. Therefore, when calculating hash values, it is
recommended to use `xxhash_64` instead of `murmur_hash3_64`. If better 64-bit
MurmurHash3 performance is needed, consider using `murmur_hash3_64`.
+
+## Syntax
+
+```sql
+MURMUR_HASH3_64_V2( <str> [ , <str> ... ] )
+```
+
+## Parameters
+
+| Parameter | Description |
+| --------- | ----------------------------------------------------- |
+| `<str>` | The value to be computed as a 64-bit MurmurHash3 hash |
+
+## Return Value
+
+Returns the 64-bit MurmurHash3 hash value of the input string.
+
+Returns NULL if any parameter is NULL.
+
+## Examples
+
+```sql
+select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"),
murmur_hash3_64_v2("hello", "world");
+```
+
+```text
++--------------------------+-----------------------------+--------------------------------------+
+| murmur_hash3_64_v2(null) | murmur_hash3_64_v2("hello") |
murmur_hash3_64_v2("hello", "world") |
++--------------------------+-----------------------------+--------------------------------------+
+| NULL | -3758069500696749310 |
-662943091231200135 |
++--------------------------+-----------------------------+--------------------------------------+
+```
\ No newline at end of file
diff --git
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
index d64ac569d8c..0d80ae09c3d 100644
---
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
+++
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64.md
@@ -9,6 +9,8 @@
Calculate 64-bit murmur3 hash value
+The difference from `MURMUR_HASH3_64_V2` is: This version is specifically
optimized for 64-bit output, with slightly better performance than the v2
version, but is inconsistent with the [standard
library](https://mmh3.readthedocs.io/en/latest/api.html#mmh3.hash64)
implementation.
+
-Note: After testing, the performance of `xxhash_64` is about twice that of
`murmur_hash3_64`, so when calculating hash values, it is recommended to use
`xxhash_64` instead of `murmur_hash3_64`.
## Syntax
@@ -27,7 +29,7 @@ MURMUR_HASH3_64( <str> [ , <str> ... ] )
Returns the 64-bit murmur3 hash of the input string.
-
+Returns NULL if any parameter input is NULL.
## Examples
diff --git
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
index 671546d1d6f..65d6c5f64ef 100644
---
a/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
+++
b/versioned_docs/version-3.x/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/xxhash-64.md
@@ -11,6 +11,10 @@ Calculates the 64-bit xxhash value of the input string
-Note: After testing, the performance of `xxhash_64` is about twice that of
`murmur_hash3_64`, so when calculating hash values, it is recommended to use
`xxhash_64` instead of `murmur_hash3_64`.
+## Alias
+
+- `XXHASH3_64`
+
## Syntax
```sql
diff --git a/versioned_sidebars/version-3.x-sidebars.json
b/versioned_sidebars/version-3.x-sidebars.json
index 8cd208a2963..4bc967a1eb1 100644
--- a/versioned_sidebars/version-3.x-sidebars.json
+++ b/versioned_sidebars/version-3.x-sidebars.json
@@ -1362,6 +1362,7 @@
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/md5sum",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-32",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64",
+
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sha",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sha2",
"sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/sm3",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]