HLL

    The correlation function:

    TOTAL UNION This function is an aggregation function, which is used to calculate the cardinality estimation of all data satisfying the conditions. This function can also be used to analyze functions. It only supports the default window and does not support the window clause.

    Coach L.u RAW AGG This function is an aggregation function that aggregates HLL type fields and returns HLL type.

    HLL_CARDINALITY(hll) This function is used to estimate the cardinality of a single HLL sequence

    HLL_HASH(column_name) Generate HLL column types for insert or import, see the instructions for the use of imports

    EMPTY_HLL() Generate empty HLL column types for insert or import, see the instructions for the use of imports

    1. Import data. See help curl for the way you import it.

      A. Generate HLL columns using columns in tables

      B. Generate HLL columns using a column in the data

      1. http://host/api/test_db/test/_stream_load
    2. There are three common ways of aggregating data: (without aggregating the base table directly, the speed may be similar to that of using APPROX_COUNT_DISTINCT directly)

    A. Create a rollup that allows HLL columns to generate aggregation. alter table test add rollup test_rollup(dt, set1);

    B. Create another table dedicated to computing uv, and insert data)

    insert into test_uv select dt, set1 from test;

    C. Create another table dedicated to computing uv, then insert and generate HLL columns from other non-hll columns of test through hll_hash

    create table test_uv( dt date, id_set hll hll_union) distributed by hash(dt) buckets 32;

    insert into test_uv select dt, hll_hash(id) from test;

    a. 27714; 24635; uv select HLL_UNION_AGG(uv_set) from test_uv;

    B. Seek every day’s UV select dt, HLL_CARDINALITY(uv_set) from test_uv;

    HLL