blob: 803cf698cb708c4df4bf4b7fed052fd8b8370db3 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>apache_beam.transforms.combiners module &mdash; Apache Beam documentation</title>
<script type="text/javascript" src="_static/js/modernizr.min.js"></script>
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="apache_beam.transforms.core module" href="apache_beam.transforms.core.html" />
<link rel="prev" title="apache_beam.transforms package" href="apache_beam.transforms.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="index.html" class="icon icon-home"> Apache Beam
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="apache_beam.coders.html">apache_beam.coders package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.internal.html">apache_beam.internal package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.io.html">apache_beam.io package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.metrics.html">apache_beam.metrics package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.ml.html">apache_beam.ml package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.options.html">apache_beam.options package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.portability.html">apache_beam.portability package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.runners.html">apache_beam.runners package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.testing.html">apache_beam.testing package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.tools.html">apache_beam.tools package</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="apache_beam.transforms.html">apache_beam.transforms package</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="apache_beam.transforms.html#submodules">Submodules</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">apache_beam.transforms.combiners module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.core.html">apache_beam.transforms.core module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.create_source.html">apache_beam.transforms.create_source module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.display.html">apache_beam.transforms.display module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.environments.html">apache_beam.transforms.environments module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external.html">apache_beam.transforms.external module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_java.html">apache_beam.transforms.external_java module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_test_py3.html">apache_beam.transforms.external_test_py3 module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.external_test_py37.html">apache_beam.transforms.external_test_py37 module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.ptransform.html">apache_beam.transforms.ptransform module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.sideinputs.html">apache_beam.transforms.sideinputs module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.stats.html">apache_beam.transforms.stats module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.timeutil.html">apache_beam.transforms.timeutil module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.transforms_keyword_only_args_test_py3.html">apache_beam.transforms.transforms_keyword_only_args_test_py3 module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.trigger.html">apache_beam.transforms.trigger module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.userstate.html">apache_beam.transforms.userstate module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.util.html">apache_beam.transforms.util module</a></li>
<li class="toctree-l3"><a class="reference internal" href="apache_beam.transforms.window.html">apache_beam.transforms.window module</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.typehints.html">apache_beam.typehints package</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.utils.html">apache_beam.utils package</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.error.html">apache_beam.error module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.pipeline.html">apache_beam.pipeline module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.pvalue.html">apache_beam.pvalue module</a></li>
<li class="toctree-l1"><a class="reference internal" href="apache_beam.version.html">apache_beam.version module</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Apache Beam</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li><a href="apache_beam.transforms.html">apache_beam.transforms package</a> &raquo;</li>
<li>apache_beam.transforms.combiners module</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/apache_beam.transforms.combiners.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="module-apache_beam.transforms.combiners">
<span id="apache-beam-transforms-combiners-module"></span><h1>apache_beam.transforms.combiners module<a class="headerlink" href="#module-apache_beam.transforms.combiners" title="Permalink to this headline"></a></h1>
<p>A library of basic combiner PTransform subclasses.</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Mean">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">Mean</code><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Mean"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Mean" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Combiners for computing arithmetic means of elements.</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Mean.Globally">
<em class="property">class </em><code class="descname">Globally</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Mean.Globally"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Mean.Globally" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>combiners.Mean.Globally computes the arithmetic mean of the elements.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Mean.Globally.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Mean.Globally.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Mean.Globally.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Mean.PerKey">
<em class="property">class </em><code class="descname">PerKey</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Mean.PerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Mean.PerKey" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>combiners.Mean.PerKey finds the means of the values for each key.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Mean.PerKey.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Mean.PerKey.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Mean.PerKey.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Count">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">Count</code><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Combiners for counting elements.</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Count.Globally">
<em class="property">class </em><code class="descname">Globally</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.Globally"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.Globally" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>combiners.Count.Globally counts the total number of elements.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Count.Globally.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.Globally.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.Globally.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Count.PerKey">
<em class="property">class </em><code class="descname">PerKey</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.PerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.PerKey" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>combiners.Count.PerKey counts how many elements each unique key has.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Count.PerKey.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.PerKey.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.PerKey.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Count.PerElement">
<em class="property">class </em><code class="descname">PerElement</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.PerElement"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.PerElement" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>combiners.Count.PerElement counts how many times each element occurs.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Count.PerElement.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Count.PerElement.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Count.PerElement.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Top">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">Top</code><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Combiners for obtaining extremal elements.</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Top.Of">
<em class="property">class </em><code class="descname">Of</code><span class="sig-paren">(</span><em>n</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.Of"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.Of" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Obtain a list of the compare-most N elements in a PCollection.</p>
<p>This transform will retrieve the n greatest elements in the PCollection
to which it is applied, where “greatest” is determined by the comparator
function supplied as the compare argument.</p>
<p>Creates a global Top operation.</p>
<p>The arguments ‘key’ and ‘reverse’ may be passed as keyword arguments,
and have the same meaning as for Python’s sort functions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pcoll</strong> – PCollection to process.</li>
<li><strong>n</strong> – number of elements to extract from pcoll.</li>
<li><strong>**kwargs</strong> – may contain ‘key’ and/or ‘reverse’</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Top.Of.default_label">
<code class="descname">default_label</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.Of.default_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.Of.default_label" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Top.Of.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.Of.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.Of.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Top.PerKey">
<em class="property">class </em><code class="descname">PerKey</code><span class="sig-paren">(</span><em>n</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.PerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.PerKey" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Identifies the compare-most N elements associated with each key.</p>
<p>This transform will produce a PCollection mapping unique keys in the input
PCollection to the n greatest elements with which they are associated, where
“greatest” is determined by the comparator function supplied as the compare
argument in the initializer.</p>
<p>Creates a per-key Top operation.</p>
<p>The arguments ‘key’ and ‘reverse’ may be passed as keyword arguments,
and have the same meaning as for Python’s sort functions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pcoll</strong> – PCollection to process.</li>
<li><strong>n</strong> – number of elements to extract from pcoll.</li>
<li><strong>**kwargs</strong> – may contain ‘key’ and/or ‘reverse’</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Top.PerKey.default_label">
<code class="descname">default_label</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.PerKey.default_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.PerKey.default_label" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Top.PerKey.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.PerKey.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.PerKey.expand" title="Permalink to this definition"></a></dt>
<dd><p>Expands the transform.</p>
<p>Raises TypeCheckError: If the output type of the input PCollection is not
compatible with Tuple[A, B].</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pcoll</strong> – PCollection to process</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the PCollection containing the result.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Top.Largest">
<em class="property">static </em><code class="descname">Largest</code><span class="sig-paren">(</span><em>pcoll</em>, <em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.Largest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.Largest" title="Permalink to this definition"></a></dt>
<dd><p>Obtain a list of the greatest N elements in a PCollection.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Top.Smallest">
<em class="property">static </em><code class="descname">Smallest</code><span class="sig-paren">(</span><em>pcoll</em>, <em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.Smallest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.Smallest" title="Permalink to this definition"></a></dt>
<dd><p>Obtain a list of the least N elements in a PCollection.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Top.LargestPerKey">
<em class="property">static </em><code class="descname">LargestPerKey</code><span class="sig-paren">(</span><em>pcoll</em>, <em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.LargestPerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.LargestPerKey" title="Permalink to this definition"></a></dt>
<dd><p>Identifies the N greatest elements associated with each key.</p>
</dd></dl>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Top.SmallestPerKey">
<em class="property">static </em><code class="descname">SmallestPerKey</code><span class="sig-paren">(</span><em>pcoll</em>, <em>n</em>, <em>reverse=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Top.SmallestPerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Top.SmallestPerKey" title="Permalink to this definition"></a></dt>
<dd><p>Identifies the N least elements associated with each key.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Sample">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">Sample</code><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Combiners for sampling n elements without replacement.</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizeGlobally">
<em class="property">class </em><code class="descname">FixedSizeGlobally</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizeGlobally"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizeGlobally" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Sample n elements from the input PCollection without replacement.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizeGlobally.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizeGlobally.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizeGlobally.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizeGlobally.display_data">
<code class="descname">display_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizeGlobally.display_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizeGlobally.display_data" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizeGlobally.default_label">
<code class="descname">default_label</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizeGlobally.default_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizeGlobally.default_label" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizePerKey">
<em class="property">class </em><code class="descname">FixedSizePerKey</code><span class="sig-paren">(</span><em>n</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizePerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizePerKey" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Sample n elements associated with each key without replacement.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizePerKey.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizePerKey.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizePerKey.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizePerKey.display_data">
<code class="descname">display_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizePerKey.display_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizePerKey.display_data" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Sample.FixedSizePerKey.default_label">
<code class="descname">default_label</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Sample.FixedSizePerKey.default_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Sample.FixedSizePerKey.default_label" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.ToList">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">ToList</code><span class="sig-paren">(</span><em>label='ToList'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToList"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToList" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>A global CombineFn that condenses a PCollection into a single list.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.ToList.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToList.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToList.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.ToDict">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">ToDict</code><span class="sig-paren">(</span><em>label='ToDict'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToDict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToDict" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>A global CombineFn that condenses a PCollection into a single dict.</p>
<p>PCollections should consist of 2-tuples, notionally (key, value) pairs.
If multiple values are associated with the same key, only one of the values
will be present in the resulting dict.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.ToDict.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToDict.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToDict.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.ToSet">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">ToSet</code><span class="sig-paren">(</span><em>label='ToSet'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToSet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToSet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>A global CombineFn that condenses a PCollection into a set.</p>
<dl class="method">
<dt id="apache_beam.transforms.combiners.ToSet.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#ToSet.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.ToSet.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Latest">
<em class="property">class </em><code class="descclassname">apache_beam.transforms.combiners.</code><code class="descname">Latest</code><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.8)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>Combiners for computing the latest element</p>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Latest.Globally">
<em class="property">class </em><code class="descname">Globally</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.Globally"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.Globally" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Compute the element with the latest timestamp from a
PCollection.</p>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Latest.Globally.add_timestamp">
<em class="property">static </em><code class="descname">add_timestamp</code><span class="sig-paren">(</span><em>element</em>, <em>timestamp=TimestampParam</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.Globally.add_timestamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.Globally.add_timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Latest.Globally.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.Globally.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.Globally.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="apache_beam.transforms.combiners.Latest.PerKey">
<em class="property">class </em><code class="descname">PerKey</code><span class="sig-paren">(</span><em>label=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.PerKey"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.PerKey" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="apache_beam.transforms.ptransform.html#apache_beam.transforms.ptransform.PTransform" title="apache_beam.transforms.ptransform.PTransform"><code class="xref py py-class docutils literal notranslate"><span class="pre">apache_beam.transforms.ptransform.PTransform</span></code></a></p>
<p>Compute elements with the latest timestamp for each key
from a keyed PCollection</p>
<dl class="staticmethod">
<dt id="apache_beam.transforms.combiners.Latest.PerKey.add_timestamp">
<em class="property">static </em><code class="descname">add_timestamp</code><span class="sig-paren">(</span><em>element</em>, <em>timestamp=TimestampParam</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.PerKey.add_timestamp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.PerKey.add_timestamp" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="apache_beam.transforms.combiners.Latest.PerKey.expand">
<code class="descname">expand</code><span class="sig-paren">(</span><em>pcoll</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/apache_beam/transforms/combiners.html#Latest.PerKey.expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#apache_beam.transforms.combiners.Latest.PerKey.expand" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="apache_beam.transforms.core.html" class="btn btn-neutral float-right" title="apache_beam.transforms.core module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="apache_beam.transforms.html" class="btn btn-neutral float-left" title="apache_beam.transforms package" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>