Frequent Items (FI) sketches are used to estimate the frequencies of items in a dataset. They are effective for identifying the most frequent items, such as the top products purchased or the most popular search queries.
Please visit Frequent Items Sketches for more information about this sketch family.
Please visit the main Apache DataSketches website for more information about DataSketches library.
If you are interested in making contributions to this project please see our Community page for how to contact us.
Merges sketches from the given column.
Creates a sketch that represents frequencies of the given column.
Returns a summary string that represents the state of the given sketch.
Returns an array of rows that include frequent items, estimates, lower and upper bounds given an error_type and a threshold.
select bqutil.datasketches.frequent_strings_sketch_to_string(bqutil.datasketches.frequent_strings_sketch_build(str, 1, 5)) from unnest(["a", "b", "c"]) as str; create or replace temp table fs_sketch(sketch bytes); insert into fs_sketch (select bqutil.datasketches.frequent_strings_sketch_build(str, 1, 5) from unnest(["a", "b", "c", "d"]) as str); insert into fs_sketch (select bqutil.datasketches.frequent_strings_sketch_build(str, 1, 5) from unnest(["a", "a", "c"]) as str); select bqutil.datasketches.frequent_strings_sketch_get_result(bqutil.datasketches.frequent_strings_sketch_merge(sketch, 5), "NO_FALSE_NEGATIVES", null) from fs_sketch; drop table fs_sketch;