Hash Functions
hll_hash_boolean(bool)
Description: Hashes data of the Boolean type.
Return type: hll_hashval
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_boolean(FALSE); hll_hash_boolean --------------------- -5451962507482445012 (1 row) |
hll_hash_boolean(bool, int32)
Description: Configures a hash seed (that is, changes the hash policy) and hashes data of the Boolean type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_boolean(FALSE, 10); hll_hash_boolean -------------------- -1169037589280886076 (1 row) |
hll_hash_smallint(smallint)
Description: Hashes data of the smallint type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_smallint(100::smallint); hll_hash_smallint --------------------- 962727970174027904 (1 row) |

If parameters with the same numeric value are hashed using different data types, the data will differ, because hash functions select different calculation policies for each type.
hll_hash_smallint(smallint, int32)
Description: Configures a hash seed (that is, changes the hash policy) and hashes data of the smallint type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_smallint(100::smallint, 10); hll_hash_smallint --------------------- -9056177146160443041 (1 row) |
hll_hash_integer(integer)
Description: Hashes data of the integer type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_integer(0); hll_hash_integer ---------------------- 5156626420896634997 (1 row) |
hll_hash_integer(integer, int32)
Description: Hashes data of the integer type and configures a hash seed (that is, changes the hash policy).
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_integer(0, 10); hll_hash_integer -------------------- -5035020264353794276 (1 row) |
hll_hash_bigint(bigint)
Description: Hashes data of the bigint type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_bigint(100::bigint); hll_hash_bigint --------------------- -2401963681423227794 (1 row) |
hll_hash_bigint(bigint, int32)
Description: Hashes data of the bigint type and configures a hash seed (that is, changes the hash policy).
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_bigint(100::bigint, 10); hll_hash_bigint --------------------- -2305749404374433531 (1 row) |
hll_hash_bytea(bytea)
Description: Hashes data of the bytea type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_bytea(E'\\x'); hll_hash_bytea ---------------- 0 (1 row) |
hll_hash_bytea(bytea, int32)
Description: Hashes data of the bytea type and configures a hash seed (that is, changes the hash policy).
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_bytea(E'\\x', 10); hll_hash_bytea --------------------- 7233188113542599437 (1 row) |
hll_hash_text(text)
Description: Hashes data of the text type.
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_text('AB'); hll_hash_text --------------------- -5666002586880275174 (1 row) |
hll_hash_text(text, int32)
Description: Hashes data of the text type and configures a hash seed (that is, changes the hash policy).
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_text('AB', 10); hll_hash_text --------------------- -2215507121143724132 (1 row) |
hll_hash_any(anytype)
Description: Hashes data of any type.
Return type: hll_hashval
Example:
1 2 3 4 5 6 7 8 9 10 11 |
gaussdb=# SELECT hll_hash_any(1); hll_hash_any ---------------------- -1316670585935156930 (1 row) gaussdb=# SELECT hll_hash_any('08:00:2b:01:02:03'::macaddr); hll_hash_any ---------------------- -3719950434455589360 (1 row) |
hll_hash_any(anytype, int32)
Description: Hashes data of any type and configures a hash seed (that is, changes the hash policy).
Return type: hll_hashval
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hash_any(1, 10); hll_hash_any ---------------------- 7048553517657992351 (1 row) |
hll_hashval_eq(hll_hashval, hll_hashval)
Description: Compares two pieces of data of the hll_hashval type to check whether they are the same.
Return type: Boolean
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hashval_eq(hll_hash_integer(1), hll_hash_integer(1)); hll_hashval_eq ---------------- t (1 row) |
hll_hashval_ne(hll_hashval, hll_hashval)
Description: Compares two pieces of data of the hll_hashval type to check whether they are different.
Return type: Boolean
Example:
1 2 3 4 5 |
gaussdb=# SELECT hll_hashval_ne(hll_hash_integer(1), hll_hash_integer(1)); hll_hashval_ne ---------------- f (1 row) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.