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 0000000000000..cbff6d7db37e1 --- /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( [ , ... ] ) +``` + +## Parameters + +| Parameter | Description | +| --------- | ----------------------------------------------------- | +| `` | 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 a8e9257f91d49..2ed040dadbe9e 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( [ , ... ] ) 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 6f90b6caf3fa6..25a213f645d59 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/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md new file mode 100644 index 0000000000000..e8b6c0de43e21 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-functions/scalar-functions/encrypt-digest-functions/murmur-hash3-64-v2.md @@ -0,0 +1,46 @@ +--- +{ + "title": "MURMUR_HASH3_64_V2", + "language": "zh-CN" +} +--- + +## 描述 + +计算 64 位 murmur3 hash 值 + +与`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_V2( [ , ... ] ) +``` + +## 参数 + +| 参数 | 说明 | +|---------|------------------------| +| `` | 需要被计算 64 位 murmur3 hash 的值 | + +## 返回值 + +返回输入字符串的 64 位 murmur3 hash 值。 + +任一参数为 NULL 时返回 NULL + +## 示例 + +```sql +select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello", "world"); +``` + +```text ++-----------------------+--------------------------+-----------------------------------+ +| murmur_hash3_64(NULL) | murmur_hash3_64('hello') | murmur_hash3_64('hello', 'world') | ++-----------------------+--------------------------+-----------------------------------+ +| NULL | -3215607508166160593 | 3583109472027628045 | ++-----------------------+--------------------------+-----------------------------------+ +``` 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 ef510773fb1d7..6d36cd0591647 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( [ , ... ] ) 返回输入字符串的 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 38bda3bf103b4..97a2ab78a0ee2 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-v2.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 new file mode 100644 index 0000000000000..1009b91f875aa --- /dev/null +++ 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 @@ -0,0 +1,46 @@ +--- +{ + "title": "MURMUR_HASH3_64_V2", + "language": "zh-CN" +} +--- + +## 描述 + +计算 64 位 murmur3 hash 值 + +与`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_V2( [ , ... ] ) +``` + +## 参数 + +| 参数 | 说明 | +|---------|------------------------| +| `` | 需要被计算 64 位 murmur3 hash 的值 | + +## 返回值 + +返回输入字符串的 64 位 murmur3 hash 值。 + +任一参数为 NULL 时返回 NULL + +## 示例 + +```sql +select murmur_hash3_64_v2(null), murmur_hash3_64_v2("hello"), murmur_hash3_64_v2("hello", "world"); +``` + +```text ++-----------------------+--------------------------+-----------------------------------+ +| murmur_hash3_64(NULL) | murmur_hash3_64('hello') | murmur_hash3_64('hello', 'world') | ++-----------------------+--------------------------+-----------------------------------+ +| NULL | -3215607508166160593 | 3583109472027628045 | ++-----------------------+--------------------------+-----------------------------------+ +``` 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 1ad6c58d22c11..6d36cd0591647 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( [ , ... ] ) 返回输入字符串的 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 b3300a397fe80..fc6af7d0acd45 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 940fdcb441527..a0d0c1cc90de5 100644 --- a/sidebars.json +++ b/sidebars.json @@ -1476,6 +1476,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 0000000000000..0a110c525b566 --- /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( [ , ... ] ) +``` + +## Parameters + +| Parameter | Description | +| --------- | ----------------------------------------------------- | +| `` | 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 d64ac569d8c9b..0d80ae09c3d8e 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( [ , ... ] ) 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 671546d1d6fb3..65d6c5f64efd8 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 10114fe45882b..cc0351f62b2a0 100644 --- a/versioned_sidebars/version-3.x-sidebars.json +++ b/versioned_sidebars/version-3.x-sidebars.json @@ -1361,6 +1361,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",