Return a boolean indicating if any bits are set in the specified range
-of a bit pattern. The start_offset
must be zero or a negative number
-indicating an offset from the rightmost bit in the pattern. n_bits is
-the number of bits to consider, counting right from the bit at
-start_offset
.
+Convert a bit pattern into an array of the dates is represents.
bits INT64, start_offset INT64, n_bits INT64
+bits INT64, submission_date DATE
OUTPUTS
-BOOLEAN
+
-Source | Edit
+Source | Edit
range (UDF)
Return an INT64 representing a range of bits from a source bit pattern.
The start_offset must be zero or a negative number indicating an offset from
@@ -3751,18 +3747,19 @@
Parameters
Source | Edit
-to_dates (UDF)
-Convert a bit pattern into an array of the dates is represents.
+from_string (UDF)
+Convert a string representing individual bits into an INT64.
+Implementation based on https://stackoverflow.com/a/51600210/1260237
See detailed docs for the bits28 suite of functions:
https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference
Parameters
INPUTS
-bits INT64, submission_date DATE
+
OUTPUTS
-ARRAY<DATE>
+
-Source | Edit
+Source | Edit
days_since_seen (UDF)
Return the position of the rightmost set bit in an INT64 bit pattern.
To determine this position, we take a bitwise AND of the bit pattern and
@@ -3782,19 +3779,26 @@
Parameters
Source | Edit
-from_string (UDF)
-Convert a string representing individual bits into an INT64.
+to_string (UDF)
+Convert an INT64 field into a 28-character string representing
+the individual bits.
Implementation based on https://stackoverflow.com/a/51600210/1260237
See detailed docs for the bits28 suite of functions:
https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference
+SELECT
+ [mozfun.bits28.to_string(1), mozfun.bits28.to_string(2), mozfun.bits28.to_string(3)]
+-- >>> ['0000000000000000000000000001',
+-- '0000000000000000000000000010',
+-- '0000000000000000000000000011']
+
Parameters
INPUTS
-s STRING
+
OUTPUTS
-INT64
+
-Source | Edit
+Source | Edit
retention (UDF)
Return a nested struct providing booleans indicating whether a given client
was active various time periods based on the passed bit pattern.
@@ -3803,26 +3807,22 @@ Parameters
bits INT64, submission_date DATE
Source | Edit
-to_string (UDF)
-Convert an INT64 field into a 28-character string representing
-the individual bits.
-Implementation based on https://stackoverflow.com/a/51600210/1260237
+active_in_range (UDF)
+Return a boolean indicating if any bits are set in the specified range
+of a bit pattern. The start_offset
must be zero or a negative number
+indicating an offset from the rightmost bit in the pattern. n_bits is
+the number of bits to consider, counting right from the bit at
+start_offset
.
See detailed docs for the bits28 suite of functions:
https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference
-SELECT
- [mozfun.bits28.to_string(1), mozfun.bits28.to_string(2), mozfun.bits28.to_string(3)]
--- >>> ['0000000000000000000000000001',
--- '0000000000000000000000000010',
--- '0000000000000000000000000011']
-
Parameters
INPUTS
-bits INT64
+bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-STRING
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/bytes/index.html b/mozfun/bytes/index.html
index a210609c5c9..a2014b463b7 100644
--- a/mozfun/bytes/index.html
+++ b/mozfun/bytes/index.html
@@ -2820,11 +2820,11 @@
-
-
- bit_pos_to_byte_pos (UDF)
+
+ extract_bits (UDF)
-
-Parameters
+Parameters
INPUTS
view_name STRING, project STRING, dataset STRING, funnels ARRAY<STRUCT<funnel_name STRING, funnel ARRAY<STRUCT<step_name STRING, events ARRAY<STRUCT<category STRING, event_name STRING>>>>>>, counts ARRAY<STRUCT<count_name STRING, events ARRAY<STRUCT<category STRING, event_name STRING>>>>
@@ -4336,7 +4346,7 @@ Usage
Example
See this dashboard
for example usage.
-Parameters
+Parameters
INPUTS
@@ -4346,7 +4356,7 @@ Parameters
Source | Edit
create_count_steps_query (Stored Procedure)
Generate the SQL statement that can be used to create an easily queryable view on events data.
-Parameters
+Parameters
INPUTS
project STRING, dataset STRING, events ARRAY<STRUCT<category STRING, event_name STRING>>
@@ -4356,7 +4366,7 @@ Parameters
Source | Edit
event_index_to_match_string (UDF)
Given an event index string, create a match string that is an exact match in the events_daily table.
-Parameters
+Parameters
INPUTS
@@ -4364,16 +4374,6 @@ Parameters
Source | Edit
-aggregate_match_strings (UDF)
-Given an array of strings that each match a single event, aggregate those into a single regex string that will match any of the events.
-Parameters
-INPUTS
-match_strings ARRAY<STRING>
-
-OUTPUTS
-
-Source | Edit
diff --git a/mozfun/glam/index.html b/mozfun/glam/index.html
index cf576864983..3fdedf046ec 100644
--- a/mozfun/glam/index.html
+++ b/mozfun/glam/index.html
@@ -75,7 +75,7 @@
-
+
Skip to content
@@ -2896,11 +2896,11 @@
-
-
- histogram_generate_linear_buckets (UDF)
+
+ histogram_cast_json (UDF)
-
+
-
@@ -2916,11 +2916,11 @@
-
-
- histogram_from_buckets_uniform (UDF)
+
+ histogram_fill_buckets (UDF)
-
+
-
@@ -2936,11 +2936,11 @@
-
-
- histogram_cast_json (UDF)
+
+ histogram_fill_buckets_dirichlet (UDF)
-
+
-
@@ -2956,11 +2956,11 @@
-
-
- histogram_fill_buckets (UDF)
+
+ histogram_buckets_cast_string_array (UDF)
-
+
-
@@ -2976,11 +2976,11 @@
-
-
- map_from_array_offsets_precise (UDF)
+
+ histogram_generate_exponential_buckets (UDF)
-
+
-
@@ -2996,11 +2996,11 @@
-
-
- histogram_generate_scalar_buckets (UDF)
+
+ histogram_generate_functional_buckets (UDF)
-
+
-
@@ -3016,11 +3016,11 @@
-
-
- histogram_generate_exponential_buckets (UDF)
+
+ histogram_generate_linear_buckets (UDF)
-
+
-
@@ -3036,11 +3036,11 @@
-
-
- histogram_generate_functional_buckets (UDF)
+
+ histogram_from_buckets_uniform (UDF)
-
+
-
@@ -3056,11 +3056,11 @@
-
-
- histogram_bucket_from_value (UDF)
+
+ histogram_normalized_sum (UDF)
-
+
-
@@ -3076,11 +3076,11 @@
-
-
- build_hour_to_datetime (UDF)
+
+ map_from_array_offsets (UDF)
-
+
-
@@ -3096,11 +3096,11 @@
-
-
- percentile (UDF)
+
+ map_from_array_offsets_precise (UDF)
-
+
-
@@ -3116,11 +3116,11 @@
-
-
- histogram_normalized_sum (UDF)
+
+ histogram_generate_scalar_buckets (UDF)
-
+
-
@@ -3136,11 +3136,11 @@
-
-
- map_from_array_offsets (UDF)
+
+ build_seconds_to_hour (UDF)
-
+
-
@@ -3156,11 +3156,11 @@
-
-
- histogram_fill_buckets_dirichlet (UDF)
+
+ fenix_build_to_build_hour (UDF)
-
+
-
@@ -3176,11 +3176,11 @@
-
-
- histogram_buckets_cast_string_array (UDF)
+
+ histogram_bucket_from_value (UDF)
-
+
-
@@ -3196,11 +3196,11 @@
-
-
- build_seconds_to_hour (UDF)
+
+ build_hour_to_datetime (UDF)
-
+
-
@@ -3216,11 +3216,11 @@
-
-
- fenix_build_to_build_hour (UDF)
+
+ percentile (UDF)
-
+
-
@@ -3736,11 +3736,11 @@
-
-
- histogram_generate_linear_buckets (UDF)
+
+ histogram_cast_json (UDF)
-
+
-
@@ -3756,11 +3756,11 @@
-
-
- histogram_from_buckets_uniform (UDF)
+
+ histogram_fill_buckets (UDF)
-
+
-
@@ -3776,11 +3776,11 @@
-
-
- histogram_cast_json (UDF)
+
+ histogram_fill_buckets_dirichlet (UDF)
-
+
-
@@ -3796,11 +3796,11 @@
-
-
- histogram_fill_buckets (UDF)
+
+ histogram_buckets_cast_string_array (UDF)
-
+
-
@@ -3816,11 +3816,11 @@
-
-
- map_from_array_offsets_precise (UDF)
+
+ histogram_generate_exponential_buckets (UDF)
-
+
-
@@ -3836,11 +3836,11 @@
-
-
- histogram_generate_scalar_buckets (UDF)
+
+ histogram_generate_functional_buckets (UDF)
-
+
-
@@ -3856,11 +3856,11 @@
-
-
- histogram_generate_exponential_buckets (UDF)
+
+ histogram_generate_linear_buckets (UDF)
-
+
-
@@ -3876,11 +3876,11 @@
-
-
- histogram_generate_functional_buckets (UDF)
+
+ histogram_from_buckets_uniform (UDF)
-
+
-
@@ -3896,11 +3896,11 @@
-
-
- histogram_bucket_from_value (UDF)
+
+ histogram_normalized_sum (UDF)
-
+
-
@@ -3916,11 +3916,11 @@
-
-
- build_hour_to_datetime (UDF)
+
+ map_from_array_offsets (UDF)
-
+
-
@@ -3936,11 +3936,11 @@
-
-
- percentile (UDF)
+
+ map_from_array_offsets_precise (UDF)
-
+
-
@@ -3956,11 +3956,11 @@
-
-
- histogram_normalized_sum (UDF)
+
+ histogram_generate_scalar_buckets (UDF)
-
+
-
@@ -3976,11 +3976,11 @@
-
-
- map_from_array_offsets (UDF)
+
+ build_seconds_to_hour (UDF)
-
+
-
@@ -3996,11 +3996,11 @@
-
-
- histogram_fill_buckets_dirichlet (UDF)
+
+ fenix_build_to_build_hour (UDF)
-
+
-
@@ -4016,11 +4016,11 @@
-
-
- histogram_buckets_cast_string_array (UDF)
+
+ histogram_bucket_from_value (UDF)
-
+
-
@@ -4036,11 +4036,11 @@
-
-
- build_seconds_to_hour (UDF)
+
+ build_hour_to_datetime (UDF)
-
+
-
@@ -4056,11 +4056,11 @@
-
-
- fenix_build_to_build_hour (UDF)
+
+ percentile (UDF)
-
+
-
@@ -4092,29 +4092,9 @@
Glam
-histogram_generate_linear_buckets (UDF)
-Generate linear buckets for a histogram.
-Parameters
-INPUTS
-min FLOAT64, max FLOAT64, nBuckets FLOAT64
-
-OUTPUTS
-ARRAY<FLOAT64>DETERMINISTIC
-
-Source | Edit
-
-Create an empty histogram from an array of buckets.
-Parameters
-INPUTS
-
-OUTPUTS
-ARRAY<STRUCT<key STRING, value FLOAT64>>
-
-Source | Edit
histogram_cast_json (UDF)
Cast a histogram into a JSON blob.
-Parameters
+Parameters
INPUTS
histogram ARRAY<STRUCT<key STRING, value FLOAT64>>
@@ -4124,7 +4104,7 @@ Parameters
Source | Edit
histogram_fill_buckets (UDF)
Interpolate missing histogram buckets with empty buckets.
-Parameters
+Parameters
INPUTS
input_map ARRAY<STRUCT<key STRING, value FLOAT64>>, buckets ARRAY<STRING>
@@ -4132,28 +4112,44 @@ Parameters
ARRAY<STRUCT<key STRING, value FLOAT64>>
Source | Edit
-map_from_array_offsets_precise (UDF)
-Parameters
+histogram_fill_buckets_dirichlet (UDF)
+Interpolate missing histogram buckets with empty buckets so it becomes a valid
+estimator for the dirichlet distribution.
+See: https://docs.google.com/document/d/1ipy1oFIKDvHr3R6Ku0goRjS11R1ZH1z2gygOGkSdqUg
+To use this, you must first:
+Aggregate the histograms to the client level, to get a histogram {k1: p1,
+k2:p2, ..., kK: pN} where the p's are proportions(and p1, p2, ... sum to 1)
+and Kis the number of buckets.
+This is then the client's estimated density, and every client has been
+reduced to one row (i.e the client's histograms are reduced to this single
+one and normalized).
+Then add all of these across clients to get {k1: P1, k2:P2, ..., kK: PK}
+where P1 = sum(p1 across N clients) and P2 = sum(p2 across N clients).
+Calculate the total number of buckets K, as well as the total number of
+profiles N reporting
+Then our estimate for final density is:
+[{k1: ((P1 + 1/K) / (nreporting+1)), k2: ((P2 + 1/K) /(nreporting+1)), ... }
+Parameters
INPUTS
-required ARRAY<FLOAT64>, `values` ARRAY<FLOAT64>
+input_map ARRAY<STRUCT<key STRING, value FLOAT64>>, buckets ARRAY<STRING>, total_users INT64
OUTPUTS
ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
-histogram_generate_scalar_buckets (UDF)
-Generate scalar buckets for a histogram using a fixed number of buckets.
-Parameters
+Source | Edit
+histogram_buckets_cast_string_array (UDF)
+Cast histogram buckets into a string array.
+Parameters
INPUTS
-min_bucket FLOAT64, max_bucket FLOAT64, num_buckets INT64
+
OUTPUTS
-ARRAY<FLOAT64>DETERMINISTIC
+
-Source | Edit
+Source | Edit
histogram_generate_exponential_buckets (UDF)
Generate exponential buckets for a histogram.
-Parameters
+Parameters
INPUTS
min FLOAT64, max FLOAT64, nBuckets FLOAT64
@@ -4168,7 +4164,7 @@ histogram_generate_functional
determined with the following function:
i = $$ \lfloor{n log_{\text{base}}{(x)}}\rfloor $$
In other words, there are n buckets for each power of base
magnitude.
-Parameters
+Parameters
INPUTS
log_base INT64, buckets_per_magnitude INT64, range_max INT64
@@ -4176,38 +4172,29 @@ Parameters
ARRAY<FLOAT64>DETERMINISTIC
Source | Edit
-histogram_bucket_from_value (UDF)
-Parameters
-INPUTS
-buckets ARRAY<STRING>, val FLOAT64
-
-OUTPUTS
-
-Source | Edit
-build_hour_to_datetime (UDF)
-Parses the custom build id used for Fenix builds in GLAM to a datetime.
-Parameters
+histogram_generate_linear_buckets (UDF)
+Generate linear buckets for a histogram.
+Parameters
INPUTS
-build_hour STRING
+min FLOAT64, max FLOAT64, nBuckets FLOAT64
OUTPUTS
-DATETIME
+ARRAY<FLOAT64>DETERMINISTIC
-Source | Edit
-percentile (UDF)
-Get the value of the approximate CDF at the given percentile.
-Parameters
+Source | Edit
+
+Create an empty histogram from an array of buckets.
+Parameters
INPUTS
-percentile FLOAT64, histogram ARRAY<STRUCT<key STRING, value FLOAT64>>, type STRING
+
OUTPUTS
-FLOAT64 DETERMINISTIC
+ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
+Source | Edit
histogram_normalized_sum (UDF)
Compute the normalized sum of an array of histograms.
-Parameters
+Parameters
INPUTS
arrs ARRAY<STRUCT<key STRING, value INT64>>, weight FLOAT64
@@ -4216,7 +4203,7 @@ Parameters
Source | Edit
map_from_array_offsets (UDF)
-Parameters
+Parameters
INPUTS
required ARRAY<FLOAT64>, `values` ARRAY<FLOAT64>
@@ -4224,44 +4211,28 @@ Parameters
ARRAY<STRUCT<key STRING, value FLOAT64>>
Source | Edit
-histogram_fill_buckets_dirichlet (UDF)
-Interpolate missing histogram buckets with empty buckets so it becomes a valid
-estimator for the dirichlet distribution.
-See: https://docs.google.com/document/d/1ipy1oFIKDvHr3R6Ku0goRjS11R1ZH1z2gygOGkSdqUg
-To use this, you must first:
-Aggregate the histograms to the client level, to get a histogram {k1: p1,
-k2:p2, ..., kK: pN} where the p's are proportions(and p1, p2, ... sum to 1)
-and Kis the number of buckets.
-This is then the client's estimated density, and every client has been
-reduced to one row (i.e the client's histograms are reduced to this single
-one and normalized).
-Then add all of these across clients to get {k1: P1, k2:P2, ..., kK: PK}
-where P1 = sum(p1 across N clients) and P2 = sum(p2 across N clients).
-Calculate the total number of buckets K, as well as the total number of
-profiles N reporting
-Then our estimate for final density is:
-[{k1: ((P1 + 1/K) / (nreporting+1)), k2: ((P2 + 1/K) /(nreporting+1)), ... }
-Parameters
+map_from_array_offsets_precise (UDF)
+Parameters
INPUTS
-input_map ARRAY<STRUCT<key STRING, value FLOAT64>>, buckets ARRAY<STRING>, total_users INT64
+required ARRAY<FLOAT64>, `values` ARRAY<FLOAT64>
OUTPUTS
ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
-histogram_buckets_cast_string_array (UDF)
-Cast histogram buckets into a string array.
-Parameters
+Source | Edit
+histogram_generate_scalar_buckets (UDF)
+Generate scalar buckets for a histogram using a fixed number of buckets.
+Parameters
INPUTS
-buckets ARRAY<INT64>
+min_bucket FLOAT64, max_bucket FLOAT64, num_buckets INT64
OUTPUTS
-ARRAY<STRING>
+ARRAY<FLOAT64>DETERMINISTIC
-Source | Edit
+Source | Edit
build_seconds_to_hour (UDF)
Returns a custom build id generated from the build seconds of a FOG build.
-Parameters
+Parameters
INPUTS
@@ -4271,7 +4242,7 @@ Parameters
Source | Edit
fenix_build_to_build_hour (UDF)
Returns a custom build id generated from the build hour of a Fenix build.
-Parameters
+Parameters
INPUTS
@@ -4279,6 +4250,35 @@ Parameters
Source | Edit
+histogram_bucket_from_value (UDF)
+Parameters
+INPUTS
+buckets ARRAY<STRING>, val FLOAT64
+
+OUTPUTS
+
+Source | Edit
+build_hour_to_datetime (UDF)
+Parses the custom build id used for Fenix builds in GLAM to a datetime.
+Parameters
+INPUTS
+
+OUTPUTS
+
+Source | Edit
+percentile (UDF)
+Get the value of the approximate CDF at the given percentile.
+Parameters
+INPUTS
+percentile FLOAT64, histogram ARRAY<STRUCT<key STRING, value FLOAT64>>, type STRING
+
+OUTPUTS
+
+Source | Edit
diff --git a/mozfun/glean/index.html b/mozfun/glean/index.html
index 0575202e456..b079d7fab90 100644
--- a/mozfun/glean/index.html
+++ b/mozfun/glean/index.html
@@ -2920,11 +2920,11 @@