Update hash_functions.md

This commit is contained in:
alexey-milovidov 2019-12-03 03:56:38 +03:00 committed by GitHub
parent a64db10135
commit 28fbfc8405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,8 +189,6 @@ SELECT javaHash('');
A `Int32` data type hash value.
Type: `javaHash`.
**Example**
Query:
@ -209,7 +207,7 @@ Result:
## javaHashUTF16LE {#javahashutf16le}
Calculates [JavaHash](http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/478a4add975b/src/share/classes/java/lang/String.java#l1452) from a string in UTF-16LE encoding.
Calculates [JavaHash](http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/478a4add975b/src/share/classes/java/lang/String.java#l1452) from a string, assuming it contains bytes representing a string in UTF-16LE encoding.
**Syntax**
@ -225,8 +223,6 @@ javaHashUTF16LE(stringUtf16le)
A `Int32` data type hash value.
Type: `javaHash`.
**Example**
Correct query with UTF-16LE encoded string.
@ -245,38 +241,6 @@ Result:
└──────────────────────────────────────────────────────────────┘
```
If string with any other encoding than `utf-16le` has passed then different hash will be returned.
Query:
```sql
SELECT javaHashUTF16LE('test')
```
Result:
```text
┌─javaHashUTF16LE('test')─┐
│ 834943 │
└─────────────────────────┘
```
Without `convertCharset` function some result will be returned.
Query:
```sql
SELECT javaHashUTF16LE('FJKLDSJFIOLD_389159837589429')
```
Result:
```text
┌─javaHashUTF16LE('FJKLDSJFIOLD_389159837589429')─┐
│ -1788019318 │
└─────────────────────────────────────────────────┘
```
## hiveHash {#hash_functions-hivehash}
Calculates `HiveHash` from a string.