User-Defined Aggregate Functions (UDAFs) and non-aggregate (scalar) functions (UDFs) for BigQuery SQL engine.
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.
- Requires Emscripten (emcc compiler)
- Requires a link to datasketches-cpp in this directory
select `$BQ_PROJECT.$BQ_DATASET`.theta_sketch_get_estimate(
`$BQ_PROJECT.$BQ_DATASET`.theta_sketch_scalar_union(
(select `$BQ_PROJECT.$BQ_DATASET`.theta_sketch_agg_string(value, null) from unnest(["1", "2", "3"]) as value),
(select `$BQ_PROJECT.$BQ_DATASET`.theta_sketch_agg_string(value, null) from unnest(["3", "4", "5"]) as value),
14, null
), null
);
result: 5