@@ -3670,6 +3670,34 @@ bits28
type of the field is a BigQuery INT64, but logically the integer
represents an array of bits, with each 1 indicating a day where the given clients
was active and each 0 indicating a day where the client was inactive.
+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
+
+OUTPUTS
+
+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
@@ -3678,7 +3706,7 @@
active_in_range (UDF)
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
bits INT64, start_offset INT64, n_bits INT64
@@ -3690,7 +3718,7 @@ to_dates (UDF)
Convert a bit pattern into an array of the dates is represents.
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
bits INT64, submission_date DATE
@@ -3715,7 +3743,7 @@ range (UDF)
WHERE
submission_date > '2020-01-01'
-Parameters
+Parameters
INPUTS
bits INT64, start_offset INT64, n_bits INT64
@@ -3723,31 +3751,12 @@ Parameters
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
-
-OUTPUTS
-
-Source | Edit
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
+Parameters
INPUTS
@@ -3755,34 +3764,25 @@ 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.
-Implementation based on https://stackoverflow.com/a/51600210/1260237
+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.to_string(1), mozfun.bits28.to_string(2), mozfun.bits28.to_string(3)]
--- >>> ['0000000000000000000000000001',
--- '0000000000000000000000000010',
--- '0000000000000000000000000011']
+ mozfun.bits28.days_since_seen(18)
+-- >> 1
Parameters
INPUTS
OUTPUTS
-
-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>>>>
@@ -4286,7 +4256,7 @@ Usage
Example
See this dashboard
for example usage.
-Parameters
+Parameters
INPUTS
@@ -4296,7 +4266,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>>
@@ -4306,7 +4276,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
@@ -4316,7 +4286,7 @@ 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
+Parameters
INPUTS
match_strings ARRAY<STRING>
@@ -4326,7 +4296,7 @@ Parameters
Source | Edit
Escape all metachars from a regex string. This will make the string an exact match, no matter what it contains.
-Parameters
+Parameters
INPUTS
@@ -4334,6 +4304,36 @@ Parameters
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
+INPUTS
+project STRING, dataset STRING, funnel ARRAY<STRUCT<list ARRAY<STRUCT<category STRING, event_name STRING>>>>
+
+OUTPUTS
+
+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
diff --git a/mozfun/glam/index.html b/mozfun/glam/index.html
index c09da6a4574..4c5679c2201 100644
--- a/mozfun/glam/index.html
+++ b/mozfun/glam/index.html
@@ -75,7 +75,7 @@
-
+
Skip to content
@@ -2856,11 +2856,11 @@
-
-
- histogram_generate_functional_buckets (UDF)
+
+ histogram_bucket_from_value (UDF)
-