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 |
+-----------------------------------------------------------------+

Enter to send ยท Shift+Enter for a new line