跳到主要内容

XXHASH_64

描述

计算输入字符串的64位xxhash值

-注:经过测试xxhash_64的性能大约是murmur_hash3_64的2倍,所以在计算hash值时,更推荐使用xxhash_64,而不是murmur_hash3_64

语法

XXHASH_64( <str> [ , <str> ... ] )

参数

参数说明
<str>需要被计算64位xxhash的值

返回值

返回输入字符串的64位xxhash值。

举例

select xxhash_64(NULL), xxhash_64("hello"), xxhash_64("hello", "world");
+-----------------+----------------------+-----------------------------+
| xxhash_64(NULL) | xxhash_64('hello') | xxhash_64('hello', 'world') |
+-----------------+----------------------+-----------------------------+
| NULL | -7685981735718036227 | 7001965798170371843 |
+-----------------+----------------------+-----------------------------+