Skip to main content
Skip to main content

HLL_FROM_BASE64

hll_from_base64

description

Syntax

HLL HLL_FROM_BASE64(VARCHAR input)

Convert a base64 string(result of function hll_to_base64) into a hll. If input string is invalid, return NULL.

example

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)

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

mysql> select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL))));
+-----------------------------------------------------------------+
| hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL)))) |
+-----------------------------------------------------------------+
| 0 |
+-----------------------------------------------------------------+
1 row in set (0.02 sec)

keywords

HLL_FROM_BASE64, HLL