The HLL type supports the following operators:
Table 1 HLL OperatorsHLL Operators
|
Description
|
Return Type
|
Example
|
=
|
Checks whether the values of hll and hll_hashval are equal.
|
bool
|
| SELECT (hll_empty() || hll_hash_integer(1)) = (hll_empty() || hll_hash_integer(1));
?column?
----------
t
(1 row)
|
| SELECT hll_hash_integer(1) = hll_hash_integer(1);
?column?
----------
t
(1 row)
|
|
<> or !=
|
Checks whetherthe values of hll and hll_hashval are not equal.
|
bool
|
| SELECT (hll_empty() || hll_hash_integer(1)) <> (hll_empty() || hll_hash_integer(2));
?column?
----------
t
(1 row)
|
| SELECT hll_hash_integer(1) <> hll_hash_integer(2);
?column?
----------
t
(1 row)
|
|
||
|
Represents the functions of hll_add, hll_union, hll_add_rev.
|
hll
|
| SELECT hll_empty() || hll_hash_integer(1);
?column?
--------------------------
\x128b7f8895a3f5af28cafe
(1 row)
|
| SELECT hll_hash_integer(1) || hll_empty();
?column?
--------------------------
\x128b7f8895a3f5af28cafe
(1 row)
|
| SELECT (hll_empty() || hll_hash_integer(1)) || (hll_empty() || hll_hash_integer(2));
?column?
------------------------------------------
\x128b7f8895a3f5af28cafeda0ce907e4355b60
(1 row)
|
|
#
|
Calculates the distinct value of the hll. It is the same as that of the hll_cardinality function.
|
integer
|
| SELECT #(hll_empty() || hll_hash_integer(1));
?column?
----------
1
(1 row)
|
|