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

  1. mysql> select hll_union_agg(hll_from_base64(hll_to_base64(pv))), hll_union_agg(pv) from test_hll;
  2. +---------------------------------------------------+-------------------+
  3. | hll_union_agg(hll_from_base64(hll_to_base64(pv))) | hll_union_agg(pv) |
  4. +---------------------------------------------------+-------------------+
  5. | 3 | 3 |
  6. +---------------------------------------------------+-------------------+
  7. 1 row in set (0.04 sec)
  8. mysql> select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc'))));
  9. +------------------------------------------------------------------+
  10. | hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('abc')))) |
  11. +------------------------------------------------------------------+
  12. | 1 |
  13. +------------------------------------------------------------------+
  14. 1 row in set (0.04 sec)
  15. mysql> select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(''))));
  16. +---------------------------------------------------------------+
  17. | hll_cardinality(hll_from_base64(hll_to_base64(hll_hash('')))) |
  18. +---------------------------------------------------------------+
  19. | 1 |
  20. +---------------------------------------------------------------+
  21. 1 row in set (0.02 sec)
  22. mysql> select hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL))));
  23. +-----------------------------------------------------------------+
  24. | hll_cardinality(hll_from_base64(hll_to_base64(hll_hash(NULL)))) |
  25. +-----------------------------------------------------------------+
  26. | 0 |
  27. +-----------------------------------------------------------------+
  28. 1 row in set (0.02 sec)

keywords

HLL_FROM_BASE64, HLL