DOCS-355: gccMurmurHash (#10395)

* docs(gccMurmurHash):added the description of function

* docs(gccMurmurHash):some changes

* Update docs/en/sql_reference/functions/hash_functions.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/functions/hash_functions.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* Update docs/en/sql_reference/functions/hash_functions.md

Co-Authored-By: BayoNet <da-daos@yandex.ru>

* docs(gccMurmurHash):some changes

* docs(gccMurmurHash):added translation of the function description

* CLICKHOUSEDOCS-355: Little fix.

* Update docs/en/sql_reference/functions/hash_functions.md

Co-Authored-By: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>

* CLICKHOUSEDOCS-355: Updated example

Co-authored-by: asiana21 <asiana21@yandex-team.ru>
Co-authored-by: AsiaKorushkina <43650329+AsiaKorushkina@users.noreply.github.com>
Co-authored-by: Sergei Shtykov <bayonet@yandex-team.ru>
Co-authored-by: Ilya Yatsishin <2159081+qoega@users.noreply.github.com>
This commit is contained in:
BayoNet 2020-04-22 09:50:45 +03:00 committed by GitHub
parent 7065a8ba9c
commit 52b6dc70fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 0 deletions

View File

@ -345,6 +345,44 @@ SELECT murmurHash2_64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:
└──────────────────────┴────────┘
```
## gccMurmurHash {#gccmurmurhash}
Calculates a 64-bit [MurmurHash2](https://github.com/aappleby/smhasher) hash value using the same hash seed as [gcc](https://github.com/gcc-mirror/gcc/blob/41d6b10e96a1de98e90a7c0378437c3255814b16/libstdc%2B%2B-v3/include/bits/functional_hash.h#L191). It is portable between CLang and GCC builds.
**Syntax**
```sql
gccMurmurHash(par1, ...);
```
**Parameters**
- `par1, ...` — A variable number of parameters that can be any of the [supported data types](../../sql_reference/data_types/index.md#data_types).
**Returned value**
- Calculated hash value.
Type: [UInt64](../../sql_reference/data_types/int_uint.md).
**Example**
Query:
```sql
SELECT
gccMurmurHash(1, 2, 3) AS res1,
gccMurmurHash(('a', [1, 2, 3], 4, (4, ['foo', 'bar'], 1, (1, 2)))) AS res2
```
Result:
``` text
┌─────────────────res1─┬────────────────res2─┐
│ 12384823029245979431 │ 1188926775431157506 │
└──────────────────────┴─────────────────────┘
```
## murmurHash3\_32, murmurHash3\_64 {#murmurhash3-32-murmurhash3-64}
Produces a [MurmurHash3](https://github.com/aappleby/smhasher) hash value.
@ -441,4 +479,5 @@ Result:
- [xxHash](http://cyan4973.github.io/xxHash/).
[Original article](https://clickhouse.tech/docs/en/query_language/functions/hash_functions/) <!--hide-->

View File

@ -342,6 +342,44 @@ SELECT murmurHash2_64(array('e','x','a'), 'mple', 10, toDateTime('2019-06-15 23:
└──────────────────────┴────────┘
```
## gccMurmurHash {#gccmurmurhash}
Вычисляет 64-битное значение [MurmurHash2](https://github.com/aappleby/smhasher), используя те же hash seed, что и [gcc](https://github.com/gcc-mirror/gcc/blob/41d6b10e96a1de98e90a7c0378437c3255814b16/libstdc%2B%2B-v3/include/bits/functional_hash.h#L191).
**Синтаксис**
```sql
gccMurmurHash(par1, ...);
```
**Параметры**
- `par1, ...` — Переменное число параметров. Каждый параметр может быть любого из [поддерживаемых типов данных](../../data_types/index.md).
**Возвращаемое значение**
- Вычисленный хэш-код.
Тип: [UInt64](../../data_types/int_uint.md).
**Примеры**
Запрос:
```sql
SELECT
gccMurmurHash(1, 2, 3) AS res1,
gccMurmurHash(('a', [1, 2, 3], 4, (4, ['foo', 'bar'], 1, (1, 2)))) AS res2
```
Результат:
``` text
┌─────────────────res1─┬────────────────res2─┐
│ 12384823029245979431 │ 1188926775431157506 │
└──────────────────────┴─────────────────────┘
```
## murmurHash3\_32, murmurHash3\_64 {#murmurhash3-32-murmurhash3-64}
Генерирует значение [MurmurHash3](https://github.com/aappleby/smhasher).