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
-its complement, then we determine the position of the bit via base-2
-logarithm; see https://stackoverflow.com/a/42747608/1260237
+Convert an INT64 field into a 28-character string representing
+the individual bits.
+INT64
+
-Source | Edit
-from_string (UDF)
-Convert a string representing individual bits into an INT64.
-Implementation based on https://stackoverflow.com/a/51600210/1260237
+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.
+Parameters
+INPUTS
+bits INT64, submission_date DATE
+
+Source | Edit
+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
-Parameters
+Parameters
INPUTS
-s STRING
+bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-
-Parameters
+Parameters
INPUTS
bits INT64, start_offset INT64, n_bits INT64
@@ -3867,62 +3891,38 @@ Parameters
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.
-Parameters
-INPUTS
-bits INT64, submission_date DATE
-
-Source | Edit
-to_string (UDF)
-Convert an INT64 field into a 28-character string representing
-the individual bits.
+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
-SELECT
- [mozfun.bits28.to_string(1), mozfun.bits28.to_string(2), mozfun.bits28.to_string(3)]
--- >>> ['0000000000000000000000000001',
--- '0000000000000000000000000010',
--- '0000000000000000000000000011']
-
-Parameters
-INPUTS
-
-OUTPUTS
-
-Source | Edit
-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
Parameters
INPUTS
-bits INT64, start_offset INT64, n_bits INT64
+
OUTPUTS
-BOOLEAN
+
-Source | Edit
-to_dates (UDF)
-Convert a bit pattern into an array of the dates is represents.
+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
+its complement, then we determine the position of the bit via base-2
+logarithm; see https://stackoverflow.com/a/42747608/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.days_since_seen(18)
+-- >> 1
+
Parameters
INPUTS
-bits INT64, submission_date DATE
+
OUTPUTS
-ARRAY<DATE>
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/bytes/index.html b/mozfun/bytes/index.html
index 1d3acb19ce5..883a2d9f4d5 100644
--- a/mozfun/bytes/index.html
+++ b/mozfun/bytes/index.html
@@ -2920,11 +2920,11 @@
-
-
- extract_bits (UDF)
+
+ zero_right (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>>>>
Source | Edit
-get_funnel_steps_sql (Stored Procedure)
-For a given funnel, get a SQL statement that can be used to determine if an events string contains that funnel.
-Parameters
-INPUTS
-project STRING, dataset STRING, funnel_name STRING, funnel ARRAY<STRUCT<step_name STRING, list ARRAY<STRUCT<category STRING, event_name STRING>>>>
-
-OUTPUTS
-
-Source | Edit
Extract the events and their counts from an events string.
This function explicitly ignores event properties, and retrieves just the counts of the top-level events.
@@ -4404,19 +4404,9 @@ Parameters
ARRAY<STRUCT<index STRING, count INT64>>
Source | Edit
-get_count_sql (Stored Procedure)
-For a given funnel, get a SQL statement that can be used to determine if an events string contains that funnel.
-Parameters
-INPUTS
-project STRING, dataset STRING, count_name STRING, events ARRAY<STRUCT<category STRING, event_name STRING>>
-
-OUTPUTS
-
-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>>
@@ -4424,19 +4414,19 @@ Parameters
Source | Edit
-create_funnel_regex (UDF)
-Given an array of match strings, each representing a single funnel step, aggregate them into a regex string that will match only against the entire funnel. If intermediate_steps is TRUE, this allows for there to be events that occur between the funnel steps.
-Parameters
+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
INPUTS
-step_regexes ARRAY<STRING>, intermediate_steps BOOLEAN
+
OUTPUTS
-Source | Edit
+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
+Parameters
INPUTS
match_strings ARRAY<STRING>
@@ -4444,16 +4434,26 @@ 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
+
+Escape all metachars from a regex string. This will make the string an exact match, no matter what it contains.
+Parameters
INPUTS
-index STRING
+
OUTPUTS
-Source | Edit
+Source | Edit
+get_funnel_steps_sql (Stored Procedure)
+For a given funnel, get a SQL statement that can be used to determine if an events string contains that funnel.
+Parameters
+INPUTS
+project STRING, dataset STRING, funnel_name STRING, funnel ARRAY<STRUCT<step_name STRING, list ARRAY<STRUCT<category STRING, event_name STRING>>>>
+
+OUTPUTS
+
+Source | Edit
create_funnel_steps_query (Stored Procedure)
Generate the SQL statement that can be used to create an easily queryable view on events data.
Parameters
@@ -4464,16 +4464,16 @@ Parameters
Source | Edit
-
-Escape all metachars from a regex string. This will make the string an exact match, no matter what it contains.
+get_count_sql (Stored Procedure)
+For a given funnel, get a SQL statement that can be used to determine if an events string contains that funnel.
Parameters
INPUTS
-s STRING
+project STRING, dataset STRING, count_name STRING, events ARRAY<STRUCT<category STRING, event_name STRING>>
OUTPUTS
-STRING
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/glam/index.html b/mozfun/glam/index.html
index 66f587b42a6..bd0afb353e5 100644
--- a/mozfun/glam/index.html
+++ b/mozfun/glam/index.html
@@ -75,7 +75,7 @@
-
+
Skip to content
@@ -2996,11 +2996,11 @@
-
-
- histogram_generate_functional_buckets (UDF)
+
+ histogram_normalized_sum (UDF)
-
+
-
@@ -3016,11 +3016,11 @@
-
-
- histogram_bucket_from_value (UDF)
+
+ map_from_array_offsets (UDF)
-
+
-
@@ -3036,11 +3036,11 @@
-
-
- histogram_generate_linear_buckets (UDF)
+
+ map_from_array_offsets_precise (UDF)
-
+
-
@@ -3056,11 +3056,11 @@
-
-
- build_hour_to_datetime (UDF)
+
+ histogram_generate_scalar_buckets (UDF)
-
+
-
@@ -3076,11 +3076,11 @@
-
-
- histogram_generate_scalar_buckets (UDF)
+
+ build_seconds_to_hour (UDF)
-
+
-
@@ -3096,11 +3096,11 @@
-
-
- histogram_cast_json (UDF)
+
+ fenix_build_to_build_hour (UDF)
-
+
-
@@ -3116,11 +3116,11 @@
-
-
- histogram_normalized_sum (UDF)
+
+ histogram_bucket_from_value (UDF)
-
+
-
@@ -3136,11 +3136,11 @@
-
-
- histogram_buckets_cast_string_array (UDF)
+
+ build_hour_to_datetime (UDF)
-
+
-
@@ -3156,11 +3156,11 @@
-
-
- build_seconds_to_hour (UDF)
+
+ percentile (UDF)
-
+
-
@@ -3176,11 +3176,11 @@
-
-
- fenix_build_to_build_hour (UDF)
+
+ histogram_cast_json (UDF)
-
+
-
@@ -3216,11 +3216,11 @@
-
-
- histogram_generate_exponential_buckets (UDF)
+
+ histogram_fill_buckets_dirichlet (UDF)
-
+
-
@@ -3236,11 +3236,11 @@
-
-
- map_from_array_offsets (UDF)
+
+ histogram_buckets_cast_string_array (UDF)
-
+
-
@@ -3256,11 +3256,11 @@
-
-
- histogram_fill_buckets_dirichlet (UDF)
+
+ histogram_generate_exponential_buckets (UDF)
-
+
-
@@ -3276,11 +3276,11 @@
-
-
- map_from_array_offsets_precise (UDF)
+
+ histogram_generate_functional_buckets (UDF)
-
+
-
@@ -3296,11 +3296,11 @@
-
-
- histogram_from_buckets_uniform (UDF)
+
+ histogram_generate_linear_buckets (UDF)
-
+
-
@@ -3316,11 +3316,11 @@
-
-
- percentile (UDF)
+
+ histogram_from_buckets_uniform (UDF)
-
+
-
@@ -3836,11 +3836,11 @@
-
-
- histogram_generate_functional_buckets (UDF)
+
+ histogram_normalized_sum (UDF)
-
+
-
@@ -3856,11 +3856,11 @@
-
-
- histogram_bucket_from_value (UDF)
+
+ map_from_array_offsets (UDF)
-
+
-
@@ -3876,11 +3876,11 @@
-
-
- histogram_generate_linear_buckets (UDF)
+
+ map_from_array_offsets_precise (UDF)
-
+
-
@@ -3896,11 +3896,11 @@
-
-
- build_hour_to_datetime (UDF)
+
+ histogram_generate_scalar_buckets (UDF)
-
+
-
@@ -3916,11 +3916,11 @@
-
-
- histogram_generate_scalar_buckets (UDF)
+
+ build_seconds_to_hour (UDF)
-
+
-
@@ -3936,11 +3936,11 @@
-
-
- histogram_cast_json (UDF)
+
+ fenix_build_to_build_hour (UDF)
-
+
-
@@ -3956,11 +3956,11 @@
-
-
- histogram_normalized_sum (UDF)
+
+ histogram_bucket_from_value (UDF)
-
+
-
@@ -3976,11 +3976,11 @@
-
-
- histogram_buckets_cast_string_array (UDF)
+
+ build_hour_to_datetime (UDF)
-
+
-
@@ -3996,11 +3996,11 @@
-
-
- build_seconds_to_hour (UDF)
+
+ percentile (UDF)
-
+
-
@@ -4016,11 +4016,11 @@
-
-
- fenix_build_to_build_hour (UDF)
+
+ histogram_cast_json (UDF)
-
+
-
@@ -4056,11 +4056,11 @@
-
-
- histogram_generate_exponential_buckets (UDF)
+
+ histogram_fill_buckets_dirichlet (UDF)
-
+
-
@@ -4076,11 +4076,11 @@
-
-
- map_from_array_offsets (UDF)
+
+ histogram_buckets_cast_string_array (UDF)
-
+
-
@@ -4096,11 +4096,11 @@
-
-
- histogram_fill_buckets_dirichlet (UDF)
+
+ histogram_generate_exponential_buckets (UDF)
-
+
-
@@ -4116,11 +4116,11 @@
-
-
- map_from_array_offsets_precise (UDF)
+
+ histogram_generate_functional_buckets (UDF)
-
+
-
@@ -4136,11 +4136,11 @@
-
-
- histogram_from_buckets_uniform (UDF)
+
+ histogram_generate_linear_buckets (UDF)
-
+
-
@@ -4156,11 +4156,11 @@
-
-
- percentile (UDF)
+
+ histogram_from_buckets_uniform (UDF)
-
+
-
@@ -4192,110 +4192,103 @@
Glam
-histogram_generate_functional_buckets (UDF)
-Generate functional buckets for a histogram. This is specific to Glean.
-See: https://github.com/mozilla/glean/blob/main/glean-core/src/histogram/functional.rs
-A functional bucketing algorithm. The bucket index of a given sample is
-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.
+histogram_normalized_sum (UDF)
+Compute the normalized sum of an array of histograms.
Parameters
INPUTS
-log_base INT64, buckets_per_magnitude INT64, range_max INT64
+arrs ARRAY<STRUCT<key STRING, value INT64>>, weight FLOAT64
OUTPUTS
-ARRAY<FLOAT64>DETERMINISTIC
+ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
-histogram_bucket_from_value (UDF)
+Source | Edit
+map_from_array_offsets (UDF)
Parameters
INPUTS
-buckets ARRAY<STRING>, val FLOAT64
+required ARRAY<FLOAT64>, `values` ARRAY<FLOAT64>
OUTPUTS
-FLOAT64
+ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
-histogram_generate_linear_buckets (UDF)
-Generate linear buckets for a histogram.
+Source | Edit
+map_from_array_offsets_precise (UDF)
Parameters
INPUTS
-min FLOAT64, max FLOAT64, nBuckets FLOAT64
+required ARRAY<FLOAT64>, `values` ARRAY<FLOAT64>
OUTPUTS
-ARRAY<FLOAT64>DETERMINISTIC
+ARRAY<STRUCT<key STRING, value FLOAT64>>
-Source | Edit
-build_hour_to_datetime (UDF)
-Parses the custom build id used for Fenix builds in GLAM to a datetime.
+Source | Edit
+histogram_generate_scalar_buckets (UDF)
+Generate scalar buckets for a histogram using a fixed number of buckets.
Parameters
INPUTS
-build_hour STRING
+min_bucket FLOAT64, max_bucket FLOAT64, num_buckets INT64
OUTPUTS
-DATETIME
+ARRAY<FLOAT64>DETERMINISTIC
-Source | Edit
-histogram_generate_scalar_buckets (UDF)
-Generate scalar buckets for a histogram using a fixed number of buckets.
+Source | Edit
+build_seconds_to_hour (UDF)
+Returns a custom build id generated from the build seconds of a FOG build.
Parameters
INPUTS
-min_bucket FLOAT64, max_bucket FLOAT64, num_buckets INT64
+
OUTPUTS
-ARRAY<FLOAT64>DETERMINISTIC
+
-Source | Edit
-histogram_cast_json (UDF)
-Cast a histogram into a JSON blob.
+Source | Edit
+fenix_build_to_build_hour (UDF)
+Returns a custom build id generated from the build hour of a Fenix build.
Parameters
INPUTS
-histogram ARRAY<STRUCT<key STRING, value FLOAT64>>
+