# HLL操作符
HLL类型支持如下操作符：
表1HLL操作符 
| HLL操作符    | 描述                                           | 返回值类型  | 示例                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|:---|
| =         | 比较hll或hll_hashval的值是否相等。                   | bool     | - hll   ``` SELECT (hll_empty() || hll_hash_integer(1)) = (hll_empty() || hll_hash_integer(1)); ?column? ---------- t (1 row) ``` - hll_hashval   ``` SELECT hll_hash_integer(1) = hll_hash_integer(1); ?column? ---------- t (1 row) ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| \<\> or != | 比较hll或hll_hashval是否不相等。                    | bool     | - hll   ``` SELECT (hll_empty() || hll_hash_integer(1)) <> (hll_empty() || hll_hash_integer(2)); ?column? ---------- t (1 row) ``` - hll_hashval   ``` SELECT hll_hash_integer(1) <> hll_hash_integer(2); ?column? ---------- t (1 row) ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| \|\|      | 可代表hll_add，hll_union，hll_add_rev三个函数的功能。 | hll    | - hll_add   ``` SELECT hll_empty() || hll_hash_integer(1); ?column? -------------------------- \x128b7f8895a3f5af28cafe (1 row) ``` - hll_add_rev   ``` SELECT hll_hash_integer(1) || hll_empty(); ?column? -------------------------- \x128b7f8895a3f5af28cafe (1 row) ``` - hll_union   ``` SELECT (hll_empty() || hll_hash_integer(1)) || (hll_empty() || hll_hash_integer(2)); ?column? ------------------------------------------ \x128b7f8895a3f5af28cafeda0ce907e4355b60 (1 row) ``` |
| #         | 计算出hll的distinct值，同hll_cardinality函数。     | integer | ``` SELECT #(hll_empty() || hll_hash_integer(1)); ?column? ---------- 1 (1 row) ```                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
   
