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
.
+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
bits INT64, start_offset INT64, n_bits INT64
+
OUTPUTS
-BOOLEAN
+
-Source | Edit
+Source | Edit
to_dates (UDF)
Convert a bit pattern into an array of the dates is represents.
See detailed docs for the bits28 suite of functions:
@@ -3698,38 +3701,52 @@
Parameters
Source | Edit
-from_string (UDF)
-Convert a string representing individual bits into an INT64.
-Implementation based on https://stackoverflow.com/a/51600210/1260237
+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
+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
+ -- Signature is bits28.range(offset_to_day_0, start_bit, number_of_bits)
+ mozfun.bits28.range(days_seen_bits, -13 + 0, 7) AS week_0_bits,
+ mozfun.bits28.range(days_seen_bits, -13 + 7, 7) AS week_1_bits
+FROM
+ telemetry.clients_last_seen
+WHERE
+ submission_date > '2020-01-01'
+
Parameters
INPUTS
-s STRING
+bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-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
+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
-SELECT
- mozfun.bits28.days_since_seen(18)
--- >> 1
-
Parameters
INPUTS
-bits INT64
+
OUTPUTS
-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.
+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.
@@ -3742,7 +3759,7 @@ to_string (UDF)
-- '0000000000000000000000000010',
-- '0000000000000000000000000011']
-Parameters
+Parameters
INPUTS
@@ -3750,39 +3767,22 @@ 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
-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
-the rightmost bit in the pattern.
-n_bits is the number of bits to consider, counting right from the bit at
-start_offset.
+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
- -- Signature is bits28.range(offset_to_day_0, start_bit, number_of_bits)
- mozfun.bits28.range(days_seen_bits, -13 + 0, 7) AS week_0_bits,
- mozfun.bits28.range(days_seen_bits, -13 + 7, 7) AS week_1_bits
-FROM
- telemetry.clients_last_seen
-WHERE
- submission_date > '2020-01-01'
-
Parameters
INPUTS
bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-INT64
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/event_analysis/index.html b/mozfun/event_analysis/index.html
index 77bca7d7af5..57e0b1a79cc 100644
--- a/mozfun/event_analysis/index.html
+++ b/mozfun/event_analysis/index.html
@@ -2840,36 +2840,46 @@
-
-
- create_funnel_steps_query (Stored Procedure)
+
+ create_events_view (Stored Procedure)
-
+
+ -
+
+ Examples
-
-
-
-
+
Parameters
@@ -2908,7 +2922,7 @@
-
-
+
Usage
@@ -2929,7 +2943,7 @@
-
-
+
Parameters
@@ -2941,46 +2955,16 @@
-
-
- create_events_view (Stored Procedure)
-
-
-
-
-
- -
-
- Usage
-
-
-
-
-
-
-
-
- -
-
- Examples
+
+
-
+
+ event_index_to_match_string (UDF)
-
+
+
+
+
+
+
+ -
+
+ aggregate_match_strings (UDF)
+
+
+
+
+
-
Parameters
@@ -3069,11 +3069,11 @@
-
-
- event_index_to_match_string (UDF)
+
+ get_funnel_steps_sql (Stored Procedure)
-
+
-
@@ -3089,11 +3089,11 @@
-
-
- aggregate_match_strings (UDF)
+
+ create_funnel_regex (UDF)
-
+
-
@@ -3109,11 +3109,11 @@
-
-
- escape_metachars (UDF)
+
+ create_funnel_steps_query (Stored Procedure)
-
+
-
@@ -3129,11 +3129,11 @@
-
-
- get_funnel_steps_sql (Stored Procedure)
+
+ escape_metachars (UDF)
-
+
-
@@ -3671,36 +3671,46 @@
-
-
- create_funnel_steps_query (Stored Procedure)
+
+ create_events_view (Stored Procedure)
-
+
+
+
+
+
+ -
+
+ Examples
-
-
-
-
+
Parameters
@@ -3739,7 +3753,7 @@
-
-
+
Usage
@@ -3760,7 +3774,7 @@
-
-
+
Parameters
@@ -3772,46 +3786,16 @@
-
-
- create_events_view (Stored Procedure)
-
-
-
-
-
- -
-
- Usage
-
-
-
-
-
-
-
-
- -
-
- Examples
+
+
-
+
+ event_index_to_match_string (UDF)
-
+
+
+
+
+
+
+ -
+
+ aggregate_match_strings (UDF)
+
+
+
+
+
-
Parameters
@@ -3900,11 +3900,11 @@
-
-
- event_index_to_match_string (UDF)
+
+ get_funnel_steps_sql (Stored Procedure)
-
+
-
@@ -3920,11 +3920,11 @@
-
-
- aggregate_match_strings (UDF)
+
+ create_funnel_regex (UDF)
-
+
-
@@ -3940,11 +3940,11 @@
-
-
- escape_metachars (UDF)
+
+ create_funnel_steps_query (Stored Procedure)
-
+
-
@@ -3960,11 +3960,11 @@
-
-
- get_funnel_steps_sql (Stored Procedure)
+
+ escape_metachars (UDF)
-
+
-
@@ -4010,68 +4010,11 @@
event_analysis
create a regex string that checks for the presence of that event. The view makes this
transparent, and allows users to simply query a boolean field representing the presence
of that event on that day.
-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
-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
-INPUTS
-step_regexes ARRAY<STRING>, intermediate_steps BOOLEAN
-
-OUTPUTS
-
-Source | Edit
-
-Extract events with event properties and their associated counts.
-Also extracts raw events and their counts. This allows for querying with and without properties in the same dashboard.
-Usage
-extract_event_counts_with_properties(
- events STRING
-)
-
-events
- A comma-separated events string,
-where each event is represented as a string
-of unicode chars.
-Example
-See this query
-for example usage.
-Caveats
-This function extracts both counts for events with each property,
-and for all events without their properties.
-This allows us to include both total counts for an event (with any
-property value), and events that don't have properties.
-Parameters
-INPUTS
-
-OUTPUTS
-ARRAY<STRUCT<event_index STRING, property_index INT64, property_value_index STRING, count INT64>>
-
-Source | Edit
create_events_view (Stored Procedure)
Create a view that queries the events_daily
table. This view currently supports both funnels and event counts.
Funnels are created as a struct, with each step in the funnel as a boolean column in the struct, indicating whether the user completed that step on that day.
Event counts are simply integers.
-Usage
+Usage
create_events_view(
view_name STRING,
project STRING,
@@ -4257,11 +4200,58 @@ Examples
GROUP BY
submission_date
-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
+
+Extract events with event properties and their associated counts.
+Also extracts raw events and their counts. This allows for querying with and without properties in the same dashboard.
+Usage
+extract_event_counts_with_properties(
+ events STRING
+)
+
+events
- A comma-separated events string,
+where each event is represented as a string
+of unicode chars.
+Example
+See this query
+for example usage.
+Caveats
+This function extracts both counts for events with each property,
+and for all events without their properties.
+This allows us to include both total counts for an event (with any
+property value), and events that don't have properties.
+Parameters
+INPUTS
+
+OUTPUTS
+ARRAY<STRUCT<event_index STRING, property_index INT64, property_value_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
+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
+
+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.
@@ -4276,7 +4266,7 @@ Usage
Example
See this dashboard
for example usage.
-Parameters
+Parameters
INPUTS
@@ -4284,6 +4274,16 @@ Parameters
ARRAY<STRUCT<index STRING, count INT64>>
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
create_count_steps_query (Stored Procedure)
Generate the SQL statement that can be used to create an easily queryable view on events data.
Parameters
@@ -4294,46 +4294,46 @@ 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.
+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
-index STRING
+project STRING, dataset STRING, funnel_name STRING, funnel ARRAY<STRUCT<step_name STRING, list ARRAY<STRUCT<category STRING, event_name STRING>>>>
OUTPUTS
-STRING
+
-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.
+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
INPUTS
-match_strings ARRAY<STRING>
+step_regexes ARRAY<STRING>, intermediate_steps BOOLEAN
OUTPUTS
-Source | Edit
-
-Escape all metachars from a regex string. This will make the string an exact match, no matter what it contains.
+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
-s STRING
+project STRING, dataset STRING, funnel ARRAY<STRUCT<list ARRAY<STRUCT<category STRING, event_name STRING>>>>
OUTPUTS
-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.
+Source | Edit
+
+Escape all metachars from a regex string. This will make the string an exact match, no matter what it contains.
Parameters
INPUTS
-project STRING, dataset STRING, funnel_name STRING, funnel ARRAY<STRUCT<step_name STRING, list ARRAY<STRUCT<category STRING, event_name STRING>>>>
+
OUTPUTS
-funnel_sql STRING
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/glam/index.html b/mozfun/glam/index.html
index e2f7147f707..94df007750b 100644
--- a/mozfun/glam/index.html
+++ b/mozfun/glam/index.html
@@ -75,7 +75,7 @@