Skip to content

Commit

Permalink
[ci skip] Deployed 5c2682a with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Unknown committed Nov 15, 2023
1 parent 8a9fb7d commit b42400b
Show file tree
Hide file tree
Showing 13 changed files with 1,129 additions and 1,569 deletions.
112 changes: 56 additions & 56 deletions mozfun/bits28/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2800,11 +2800,11 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#active_in_range-udf" class="md-nav__link">
active_in_range (UDF)
<a href="#to_dates-udf" class="md-nav__link">
to_dates (UDF)
</a>

<nav class="md-nav" aria-label="active_in_range (UDF)">
<nav class="md-nav" aria-label="to_dates (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -2840,11 +2840,11 @@
</li>

<li class="md-nav__item">
<a href="#to_dates-udf" class="md-nav__link">
to_dates (UDF)
<a href="#from_string-udf" class="md-nav__link">
from_string (UDF)
</a>

<nav class="md-nav" aria-label="to_dates (UDF)">
<nav class="md-nav" aria-label="from_string (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -2880,11 +2880,11 @@
</li>

<li class="md-nav__item">
<a href="#from_string-udf" class="md-nav__link">
from_string (UDF)
<a href="#to_string-udf" class="md-nav__link">
to_string (UDF)
</a>

<nav class="md-nav" aria-label="from_string (UDF)">
<nav class="md-nav" aria-label="to_string (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -2920,11 +2920,11 @@
</li>

<li class="md-nav__item">
<a href="#to_string-udf" class="md-nav__link">
to_string (UDF)
<a href="#active_in_range-udf" class="md-nav__link">
active_in_range (UDF)
</a>

<nav class="md-nav" aria-label="to_string (UDF)">
<nav class="md-nav" aria-label="active_in_range (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3542,11 +3542,11 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#active_in_range-udf" class="md-nav__link">
active_in_range (UDF)
<a href="#to_dates-udf" class="md-nav__link">
to_dates (UDF)
</a>

<nav class="md-nav" aria-label="active_in_range (UDF)">
<nav class="md-nav" aria-label="to_dates (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3582,11 +3582,11 @@
</li>

<li class="md-nav__item">
<a href="#to_dates-udf" class="md-nav__link">
to_dates (UDF)
<a href="#from_string-udf" class="md-nav__link">
from_string (UDF)
</a>

<nav class="md-nav" aria-label="to_dates (UDF)">
<nav class="md-nav" aria-label="from_string (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3622,11 +3622,11 @@
</li>

<li class="md-nav__item">
<a href="#from_string-udf" class="md-nav__link">
from_string (UDF)
<a href="#to_string-udf" class="md-nav__link">
to_string (UDF)
</a>

<nav class="md-nav" aria-label="from_string (UDF)">
<nav class="md-nav" aria-label="to_string (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3662,11 +3662,11 @@
</li>

<li class="md-nav__item">
<a href="#to_string-udf" class="md-nav__link">
to_string (UDF)
<a href="#active_in_range-udf" class="md-nav__link">
active_in_range (UDF)
</a>

<nav class="md-nav" aria-label="to_string (UDF)">
<nav class="md-nav" aria-label="active_in_range (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3710,22 +3710,18 @@ <h1 id="bits28">bits28</h1>
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.</p>
<h2 id="active_in_range-udf">active_in_range (UDF)</h2>
<p>Return a boolean indicating if any bits are set in the specified range
of a bit pattern. The <code>start_offset</code> 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
<code>start_offset</code>.</p>
<h2 id="to_dates-udf">to_dates (UDF)</h2>
<p>Convert a bit pattern into an array of the dates is represents.</p>
<p>See detailed docs for the bits28 suite of functions:
<a href="https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference">https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference</a></p>
<h3 id="parameters">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>bits INT64, start_offset INT64, n_bits INT64
<div class="highlight"><pre><span></span><code>bits INT64, submission_date DATE
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>BOOLEAN
<div class="highlight"><pre><span></span><code>ARRAY&lt;DATE&gt;
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/active_in_range">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/active_in_range/metadata.yaml">Edit</a></p>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/to_dates">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/to_dates/metadata.yaml">Edit</a></p>
<h2 id="range-udf">range (UDF)</h2>
<p>Return an INT64 representing a range of bits from a source bit pattern.</p>
<p>The start_offset must be zero or a negative number indicating an offset from
Expand All @@ -3751,18 +3747,19 @@ <h3 id="parameters_1">Parameters</h3>
<div class="highlight"><pre><span></span><code>INT64
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/range">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/range/metadata.yaml">Edit</a></p>
<h2 id="to_dates-udf">to_dates (UDF)</h2>
<p>Convert a bit pattern into an array of the dates is represents.</p>
<h2 id="from_string-udf">from_string (UDF)</h2>
<p>Convert a string representing individual bits into an INT64.</p>
<p>Implementation based on <a href="https://stackoverflow.com/a/51600210/1260237">https://stackoverflow.com/a/51600210/1260237</a></p>
<p>See detailed docs for the bits28 suite of functions:
<a href="https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference">https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference</a></p>
<h3 id="parameters_2">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>bits INT64, submission_date DATE
<div class="highlight"><pre><span></span><code>s STRING
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>ARRAY&lt;DATE&gt;
<div class="highlight"><pre><span></span><code>INT64
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/to_dates">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/to_dates/metadata.yaml">Edit</a></p>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/from_string">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/from_string/metadata.yaml">Edit</a></p>
<h2 id="days_since_seen-udf">days_since_seen (UDF)</h2>
<p>Return the position of the rightmost set bit in an INT64 bit pattern.</p>
<p>To determine this position, we take a bitwise AND of the bit pattern and
Expand All @@ -3782,19 +3779,26 @@ <h3 id="parameters_3">Parameters</h3>
<div class="highlight"><pre><span></span><code>INT64
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/days_since_seen">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/days_since_seen/metadata.yaml">Edit</a></p>
<h2 id="from_string-udf">from_string (UDF)</h2>
<p>Convert a string representing individual bits into an INT64.</p>
<h2 id="to_string-udf">to_string (UDF)</h2>
<p>Convert an INT64 field into a 28-character string representing
the individual bits.</p>
<p>Implementation based on <a href="https://stackoverflow.com/a/51600210/1260237">https://stackoverflow.com/a/51600210/1260237</a></p>
<p>See detailed docs for the bits28 suite of functions:
<a href="https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference">https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference</a></p>
<div class="highlight"><pre><span></span><code><span class="k">SELECT</span>
<span class="w"> </span><span class="p">[</span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span><span class="w"> </span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span><span class="w"> </span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="c1">-- &gt;&gt;&gt; [&#39;0000000000000000000000000001&#39;,</span>
<span class="c1">-- &#39;0000000000000000000000000010&#39;,</span>
<span class="c1">-- &#39;0000000000000000000000000011&#39;]</span>
</code></pre></div>
<h3 id="parameters_4">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>s STRING
<div class="highlight"><pre><span></span><code>bits INT64
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>INT64
<div class="highlight"><pre><span></span><code>STRING
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/from_string">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/from_string/metadata.yaml">Edit</a></p>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/to_string">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/to_string/metadata.yaml">Edit</a></p>
<h2 id="retention-udf">retention (UDF)</h2>
<p>Return a nested struct providing booleans indicating whether a given client
was active various time periods based on the passed bit pattern.</p>
Expand All @@ -3803,26 +3807,22 @@ <h3 id="parameters_5">Parameters</h3>
<div class="highlight"><pre><span></span><code>bits INT64, submission_date DATE
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/retention">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/retention/metadata.yaml">Edit</a></p>
<h2 id="to_string-udf">to_string (UDF)</h2>
<p>Convert an INT64 field into a 28-character string representing
the individual bits.</p>
<p>Implementation based on <a href="https://stackoverflow.com/a/51600210/1260237">https://stackoverflow.com/a/51600210/1260237</a></p>
<h2 id="active_in_range-udf">active_in_range (UDF)</h2>
<p>Return a boolean indicating if any bits are set in the specified range
of a bit pattern. The <code>start_offset</code> 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
<code>start_offset</code>.</p>
<p>See detailed docs for the bits28 suite of functions:
<a href="https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference">https://docs.telemetry.mozilla.org/cookbooks/clients_last_seen_bits.html#udf-reference</a></p>
<div class="highlight"><pre><span></span><code><span class="k">SELECT</span>
<span class="w"> </span><span class="p">[</span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span><span class="w"> </span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">2</span><span class="p">),</span><span class="w"> </span><span class="n">mozfun</span><span class="p">.</span><span class="n">bits28</span><span class="p">.</span><span class="n">to_string</span><span class="p">(</span><span class="mi">3</span><span class="p">)]</span>
<span class="c1">-- &gt;&gt;&gt; [&#39;0000000000000000000000000001&#39;,</span>
<span class="c1">-- &#39;0000000000000000000000000010&#39;,</span>
<span class="c1">-- &#39;0000000000000000000000000011&#39;]</span>
</code></pre></div>
<h3 id="parameters_6">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>bits INT64
<div class="highlight"><pre><span></span><code>bits INT64, start_offset INT64, n_bits INT64
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>STRING
<div class="highlight"><pre><span></span><code>BOOLEAN
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/to_string">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/to_string/metadata.yaml">Edit</a></p>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bits28/active_in_range">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bits28/active_in_range/metadata.yaml">Edit</a></p>



Expand Down
62 changes: 31 additions & 31 deletions mozfun/bytes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2820,11 +2820,11 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#bit_pos_to_byte_pos-udf" class="md-nav__link">
bit_pos_to_byte_pos (UDF)
<a href="#extract_bits-udf" class="md-nav__link">
extract_bits (UDF)
</a>

<nav class="md-nav" aria-label="bit_pos_to_byte_pos (UDF)">
<nav class="md-nav" aria-label="extract_bits (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand All @@ -2840,11 +2840,11 @@
</li>

<li class="md-nav__item">
<a href="#extract_bits-udf" class="md-nav__link">
extract_bits (UDF)
<a href="#zero_right-udf" class="md-nav__link">
zero_right (UDF)
</a>

<nav class="md-nav" aria-label="extract_bits (UDF)">
<nav class="md-nav" aria-label="zero_right (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand All @@ -2860,11 +2860,11 @@
</li>

<li class="md-nav__item">
<a href="#zero_right-udf" class="md-nav__link">
zero_right (UDF)
<a href="#bit_pos_to_byte_pos-udf" class="md-nav__link">
bit_pos_to_byte_pos (UDF)
</a>

<nav class="md-nav" aria-label="zero_right (UDF)">
<nav class="md-nav" aria-label="bit_pos_to_byte_pos (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3462,11 +3462,11 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#bit_pos_to_byte_pos-udf" class="md-nav__link">
bit_pos_to_byte_pos (UDF)
<a href="#extract_bits-udf" class="md-nav__link">
extract_bits (UDF)
</a>

<nav class="md-nav" aria-label="bit_pos_to_byte_pos (UDF)">
<nav class="md-nav" aria-label="extract_bits (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand All @@ -3482,11 +3482,11 @@
</li>

<li class="md-nav__item">
<a href="#extract_bits-udf" class="md-nav__link">
extract_bits (UDF)
<a href="#zero_right-udf" class="md-nav__link">
zero_right (UDF)
</a>

<nav class="md-nav" aria-label="extract_bits (UDF)">
<nav class="md-nav" aria-label="zero_right (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand All @@ -3502,11 +3502,11 @@
</li>

<li class="md-nav__item">
<a href="#zero_right-udf" class="md-nav__link">
zero_right (UDF)
<a href="#bit_pos_to_byte_pos-udf" class="md-nav__link">
bit_pos_to_byte_pos (UDF)
</a>

<nav class="md-nav" aria-label="zero_right (UDF)">
<nav class="md-nav" aria-label="bit_pos_to_byte_pos (UDF)">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -3537,17 +3537,6 @@


<h1 id="bytes">bytes</h1>
<h2 id="bit_pos_to_byte_pos-udf">bit_pos_to_byte_pos (UDF)</h2>
<p>Given a bit position, get the byte that bit appears in.
1-indexed (to match substr), and accepts negative values.</p>
<h3 id="parameters">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>bit_pos INT64
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>INT64
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bytes/bit_pos_to_byte_pos">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bytes/bit_pos_to_byte_pos/metadata.yaml">Edit</a></p>
<h2 id="extract_bits-udf">extract_bits (UDF)</h2>
<p>Extract bits from a byte array. Roughly matches substr
with three arguments:
Expand All @@ -3562,7 +3551,7 @@ <h2 id="extract_bits-udf">extract_bits (UDF)</h2>
<p>Examples:
bytes.extract_bits(b'\x0F\xF0', 5, 8) = b'\xFF'
bytes.extract_bits(b'\x0C\xC0', -12, 8) = b'\xCC'</p>
<h3 id="parameters_1">Parameters</h3>
<h3 id="parameters">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>b BYTES, `begin` INT64, length INT64
</code></pre></div>
Expand All @@ -3572,14 +3561,25 @@ <h3 id="parameters_1">Parameters</h3>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bytes/extract_bits">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bytes/extract_bits/metadata.yaml">Edit</a></p>
<h2 id="zero_right-udf">zero_right (UDF)</h2>
<p>Zero bits on the right of byte</p>
<h3 id="parameters_2">Parameters</h3>
<h3 id="parameters_1">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>b BYTES, length INT64
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>BYTES
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bytes/zero_right">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bytes/zero_right/metadata.yaml">Edit</a></p>
<h2 id="bit_pos_to_byte_pos-udf">bit_pos_to_byte_pos (UDF)</h2>
<p>Given a bit position, get the byte that bit appears in.
1-indexed (to match substr), and accepts negative values.</p>
<h3 id="parameters_2">Parameters</h3>
<p><strong>INPUTS</strong></p>
<div class="highlight"><pre><span></span><code>bit_pos INT64
</code></pre></div>
<p><strong>OUTPUTS</strong></p>
<div class="highlight"><pre><span></span><code>INT64
</code></pre></div>
<p><a href="https://github.com/mozilla/bigquery-etl/blob/generated-sql/sql//mozfun/bytes/bit_pos_to_byte_pos">Source</a> | <a href="https://github.com/mozilla/bigquery-etl/edit/generated-sql/sql//mozfun/bytes/bit_pos_to_byte_pos/metadata.yaml">Edit</a></p>



Expand Down
Loading

0 comments on commit b42400b

Please sign in to comment.