Skip to content

apache/datasketches-bigquery

Repository files navigation

Apache DataSketches functions for Google Cloud BigQuery

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.

Building

Example

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

Releases

No releases published

Packages

No packages published