Return a nested struct providing booleans indicating whether a given client
-was active various time periods based on the passed bit pattern.
-Convert an INT64 field into a 28-character string representing
the individual bits.
@@ -3770,7 +3762,7 @@ 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 a nested struct providing booleans indicating whether a given client
+was active various time periods based on the passed bit pattern.
+Convert a string representing individual bits into an INT64.
+bits INT64, start_offset INT64, n_bits INT64
+
OUTPUTS
-BOOLEAN
+
-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.
+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
- -- 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'
+ mozfun.bits28.days_since_seen(18)
+-- >> 1
Parameters
INPUTS
-bits INT64, start_offset INT64, n_bits INT64
+
OUTPUTS
-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:
@@ -3831,38 +3822,47 @@
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
+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
- mozfun.bits28.days_since_seen(18)
--- >> 1
+ -- 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
+bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-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
+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
-s STRING
+bits INT64, start_offset INT64, n_bits INT64
OUTPUTS
-INT64
+
-Source | Edit
+Source | Edit
diff --git a/mozfun/bytes/index.html b/mozfun/bytes/index.html
index 1efef7d6b02..d1b9f7822c6 100644
--- a/mozfun/bytes/index.html
+++ b/mozfun/bytes/index.html
@@ -2860,11 +2860,11 @@
-
-
- bit_pos_to_byte_pos (UDF)
+
+ extract_bits (UDF)
-