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

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

keywords

HLL_TO_BASE64, HLL