VeloDB Cloud
SQL Manual
SQL Functions
HLL Functions
HLL_TO_BASE64

hll_to_base64

description

Syntax

VARCHAR HLL_TO_BASE64(HLL input)

Convert an input hll to a base64 string. If input is NULL, return NULL.

example

mysql> select hll_to_base64(NULL);
+---------------------+
| hll_to_base64(NULL) |
+---------------------+
| NULL                |
+---------------------+
1 row in set (0.00 sec)

mysql> select hll_to_base64(hll_empty());
+----------------------------+
| hll_to_base64(hll_empty()) |
+----------------------------+
| AA==                       |
+----------------------------+
1 row in set (0.02 sec)

mysql> select hll_to_base64(hll_hash('abc'));
+--------------------------------+
| hll_to_base64(hll_hash('abc')) |
+--------------------------------+
| AQEC5XSzrpDsdw==               |
+--------------------------------+
1 row in set (0.03 sec)

mysql> select hll_union_agg(hll_from_base64(hll_to_base64(pv))), hll_union_agg(pv) from test_hll;
+---------------------------------------------------+-------------------+
| hll_union_agg(hll_from_base64(hll_to_base64(pv))) | hll_union_agg(pv) |
+---------------------------------------------------+-------------------+
|                                                 3 |                 3 |
+---------------------------------------------------+-------------------+
1 row in set (0.04 sec)

mysql>  select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc'))));
+------------------------------------------------------------------+
| hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc')))) |
+------------------------------------------------------------------+
|                                                                1 |
+------------------------------------------------------------------+
1 row in set (0.04 sec)

keywords

HLL_TO_BASE64, HLL