Skip to main content

HLL_FROM_BASE64

Description​

Converts a base64-encoded string (usually the result of the HLL_TO_BASE64 function) into an HLL. If the input string is invalid or NULL, the function returns NULL.

Syntax​

HLL_FROM_BASE64(<input>)

Parameters​

ParameterDescription
<input>A base64-encoded string, typically generated by the HLL_TO_BASE64 function. If the input string is invalid or NULL, the function returns NULL.

Examples​

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 |
+---------------------------------------------------+-------------------+
select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc'))));
+------------------------------------------------------------------+
| hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc')))) |
+------------------------------------------------------------------+
| 1 |
+------------------------------------------------------------------+
select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(''))));
+---------------------------------------------------------------+
| hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('')))) |
+---------------------------------------------------------------+
| 1 |
+---------------------------------------------------------------+
select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL))));
+-----------------------------------------------------------------+
| hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL)))) |
+-----------------------------------------------------------------+
| 0 |
+-----------------------------------------------------------------+