<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pyspark.accumulators — PySpark master documentation</title>
<link rel="stylesheet" href="../../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../../',
VERSION: 'master',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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>
<link rel="top" title="PySpark master documentation" href="../../index.html" />
<link rel="up" title="Module code" href="../index.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="../../index.html">PySpark master documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../index.html" accesskey="U">Module code</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pyspark.accumulators</h1><div class="highlight"><pre>
<span class="c">#</span>
<span class="c"># Licensed to the Apache Software Foundation (ASF) under one or more</span>
<span class="c"># contributor license agreements. See the NOTICE file distributed with</span>
<span class="c"># this work for additional information regarding copyright ownership.</span>
<span class="c"># The ASF licenses this file to You under the Apache License, Version 2.0</span>
<span class="c"># (the "License"); you may not use this file except in compliance with</span>
<span class="c"># the License. You may obtain a copy of the License at</span>
<span class="c">#</span>
<span class="c"># http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c">#</span>
<span class="c"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c"># distributed under the License is distributed on an "AS IS" BASIS,</span>
<span class="c"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c"># See the License for the specific language governing permissions and</span>
<span class="c"># limitations under the License.</span>
<span class="c">#</span>
<span class="sd">"""</span>
<span class="sd">>>> from pyspark.context import SparkContext</span>
<span class="sd">>>> sc = SparkContext('local', 'test')</span>
<span class="sd">>>> a = sc.accumulator(1)</span>
<span class="sd">>>> a.value</span>
<span class="sd">1</span>
<span class="sd">>>> a.value = 2</span>
<span class="sd">>>> a.value</span>
<span class="sd">2</span>
<span class="sd">>>> a += 5</span>
<span class="sd">>>> a.value</span>
<span class="sd">7</span>
<span class="sd">>>> sc.accumulator(1.0).value</span>
<span class="sd">1.0</span>
<span class="sd">>>> sc.accumulator(1j).value</span>
<span class="sd">1j</span>
<span class="sd">>>> rdd = sc.parallelize([1,2,3])</span>
<span class="sd">>>> def f(x):</span>
<span class="sd">... global a</span>
<span class="sd">... a += x</span>
<span class="sd">>>> rdd.foreach(f)</span>
<span class="sd">>>> a.value</span>
<span class="sd">13</span>
<span class="sd">>>> b = sc.accumulator(0)</span>
<span class="sd">>>> def g(x):</span>
<span class="sd">... b.add(x)</span>
<span class="sd">>>> rdd.foreach(g)</span>
<span class="sd">>>> b.value</span>
<span class="sd">6</span>
<span class="sd">>>> from pyspark.accumulators import AccumulatorParam</span>
<span class="sd">>>> class VectorAccumulatorParam(AccumulatorParam):</span>
<span class="sd">... def zero(self, value):</span>
<span class="sd">... return [0.0] * len(value)</span>
<span class="sd">... def addInPlace(self, val1, val2):</span>
<span class="sd">... for i in range(len(val1)):</span>
<span class="sd">... val1[i] += val2[i]</span>
<span class="sd">... return val1</span>
<span class="sd">>>> va = sc.accumulator([1.0, 2.0, 3.0], VectorAccumulatorParam())</span>
<span class="sd">>>> va.value</span>
<span class="sd">[1.0, 2.0, 3.0]</span>
<span class="sd">>>> def g(x):</span>
<span class="sd">... global va</span>
<span class="sd">... va += [x] * 3</span>
<span class="sd">>>> rdd.foreach(g)</span>
<span class="sd">>>> va.value</span>
<span class="sd">[7.0, 8.0, 9.0]</span>
<span class="sd">>>> rdd.map(lambda x: a.value).collect() # doctest: +IGNORE_EXCEPTION_DETAIL</span>
<span class="sd">Traceback (most recent call last):</span>
<span class="sd"> ...</span>
<span class="sd">Py4JJavaError:...</span>
<span class="sd">>>> def h(x):</span>
<span class="sd">... global a</span>
<span class="sd">... a.value = 7</span>
<span class="sd">>>> rdd.foreach(h) # doctest: +IGNORE_EXCEPTION_DETAIL</span>
<span class="sd">Traceback (most recent call last):</span>
<span class="sd"> ...</span>
<span class="sd">Py4JJavaError:...</span>
<span class="sd">>>> sc.accumulator([1.0, 2.0, 3.0]) # doctest: +IGNORE_EXCEPTION_DETAIL</span>
<span class="sd">Traceback (most recent call last):</span>
<span class="sd"> ...</span>
<span class="sd">TypeError:...</span>
<span class="sd">"""</span>
<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">import</span> <span class="nn">select</span>
<span class="kn">import</span> <span class="nn">struct</span>
<span class="k">if</span> <span class="n">sys</span><span class="o">.</span><span class="n">version</span> <span class="o"><</span> <span class="s">'3'</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">SocketServer</span>
<span class="k">else</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">socketserver</span> <span class="kn">as</span> <span class="nn">SocketServer</span>
<span class="kn">import</span> <span class="nn">threading</span>
<span class="kn">from</span> <span class="nn">pyspark.cloudpickle</span> <span class="kn">import</span> <span class="n">CloudPickler</span>
<span class="kn">from</span> <span class="nn">pyspark.serializers</span> <span class="kn">import</span> <span class="n">read_int</span><span class="p">,</span> <span class="n">PickleSerializer</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s">'Accumulator'</span><span class="p">,</span> <span class="s">'AccumulatorParam'</span><span class="p">]</span>
<span class="n">pickleSer</span> <span class="o">=</span> <span class="n">PickleSerializer</span><span class="p">()</span>
<span class="c"># Holds accumulators registered on the current machine, keyed by ID. This is then used to send</span>
<span class="c"># the local accumulator updates back to the driver program at the end of a task.</span>
<span class="n">_accumulatorRegistry</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">def</span> <span class="nf">_deserialize_accumulator</span><span class="p">(</span><span class="n">aid</span><span class="p">,</span> <span class="n">zero_value</span><span class="p">,</span> <span class="n">accum_param</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">pyspark.accumulators</span> <span class="kn">import</span> <span class="n">_accumulatorRegistry</span>
<span class="n">accum</span> <span class="o">=</span> <span class="n">Accumulator</span><span class="p">(</span><span class="n">aid</span><span class="p">,</span> <span class="n">zero_value</span><span class="p">,</span> <span class="n">accum_param</span><span class="p">)</span>
<span class="n">accum</span><span class="o">.</span><span class="n">_deserialized</span> <span class="o">=</span> <span class="bp">True</span>
<span class="n">_accumulatorRegistry</span><span class="p">[</span><span class="n">aid</span><span class="p">]</span> <span class="o">=</span> <span class="n">accum</span>
<span class="k">return</span> <span class="n">accum</span>
<div class="viewcode-block" id="Accumulator"><a class="viewcode-back" href="../../pyspark.html#pyspark.Accumulator">[docs]</a><span class="k">class</span> <span class="nc">Accumulator</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> A shared variable that can be accumulated, i.e., has a commutative and associative "add"</span>
<span class="sd"> operation. Worker tasks on a Spark cluster can add values to an Accumulator with the C{+=}</span>
<span class="sd"> operator, but only the driver program is allowed to access its value, using C{value}.</span>
<span class="sd"> Updates from the workers get propagated automatically to the driver program.</span>
<span class="sd"> While C{SparkContext} supports accumulators for primitive data types like C{int} and</span>
<span class="sd"> C{float}, users can also define accumulators for custom types by providing a custom</span>
<span class="sd"> L{AccumulatorParam} object. Refer to the doctest of this module for an example.</span>
<span class="sd"> """</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">aid</span><span class="p">,</span> <span class="n">value</span><span class="p">,</span> <span class="n">accum_param</span><span class="p">):</span>
<span class="sd">"""Create a new Accumulator with a given initial value and AccumulatorParam object"""</span>
<span class="kn">from</span> <span class="nn">pyspark.accumulators</span> <span class="kn">import</span> <span class="n">_accumulatorRegistry</span>
<span class="bp">self</span><span class="o">.</span><span class="n">aid</span> <span class="o">=</span> <span class="n">aid</span>
<span class="bp">self</span><span class="o">.</span><span class="n">accum_param</span> <span class="o">=</span> <span class="n">accum_param</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_value</span> <span class="o">=</span> <span class="n">value</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_deserialized</span> <span class="o">=</span> <span class="bp">False</span>
<span class="n">_accumulatorRegistry</span><span class="p">[</span><span class="n">aid</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span>
<span class="k">def</span> <span class="nf">__reduce__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""Custom serialization; saves the zero value from our AccumulatorParam"""</span>
<span class="n">param</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">accum_param</span>
<span class="k">return</span> <span class="p">(</span><span class="n">_deserialize_accumulator</span><span class="p">,</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">aid</span><span class="p">,</span> <span class="n">param</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_value</span><span class="p">),</span> <span class="n">param</span><span class="p">))</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">"""Get the accumulator's value; only usable in driver program"""</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_deserialized</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">"Accumulator.value cannot be accessed inside tasks"</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_value</span>
<span class="nd">@value.setter</span>
<span class="k">def</span> <span class="nf">value</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="sd">"""Sets the accumulator's value; only usable in driver program"""</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_deserialized</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">"Accumulator.value cannot be accessed inside tasks"</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_value</span> <span class="o">=</span> <span class="n">value</span>
<div class="viewcode-block" id="Accumulator.add"><a class="viewcode-back" href="../../pyspark.html#pyspark.Accumulator.add">[docs]</a> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">term</span><span class="p">):</span>
<span class="sd">"""Adds a term to this accumulator's value"""</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">accum_param</span><span class="o">.</span><span class="n">addInPlace</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_value</span><span class="p">,</span> <span class="n">term</span><span class="p">)</span>
</div>
<span class="k">def</span> <span class="nf">__iadd__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">term</span><span class="p">):</span>
<span class="sd">"""The += operator; adds a term to this accumulator's value"""</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">term</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span>
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_value</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s">"Accumulator<id=</span><span class="si">%i</span><span class="s">, value=</span><span class="si">%s</span><span class="s">>"</span> <span class="o">%</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">aid</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_value</span><span class="p">)</span>
</div>
<div class="viewcode-block" id="AccumulatorParam"><a class="viewcode-back" href="../../pyspark.html#pyspark.AccumulatorParam">[docs]</a><span class="k">class</span> <span class="nc">AccumulatorParam</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Helper object that defines how to accumulate values of a given type.</span>
<span class="sd"> """</span>
<div class="viewcode-block" id="AccumulatorParam.zero"><a class="viewcode-back" href="../../pyspark.html#pyspark.AccumulatorParam.zero">[docs]</a> <span class="k">def</span> <span class="nf">zero</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Provide a "zero value" for the type, compatible in dimensions with the</span>
<span class="sd"> provided C{value} (e.g., a zero vector)</span>
<span class="sd"> """</span>
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
</div>
<div class="viewcode-block" id="AccumulatorParam.addInPlace"><a class="viewcode-back" href="../../pyspark.html#pyspark.AccumulatorParam.addInPlace">[docs]</a> <span class="k">def</span> <span class="nf">addInPlace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value1</span><span class="p">,</span> <span class="n">value2</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> Add two values of the accumulator's data type, returning a new value;</span>
<span class="sd"> for efficiency, can also update C{value1} in place and return it.</span>
<span class="sd"> """</span>
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
</div></div>
<span class="k">class</span> <span class="nc">AddingAccumulatorParam</span><span class="p">(</span><span class="n">AccumulatorParam</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> An AccumulatorParam that uses the + operators to add values. Designed for simple types</span>
<span class="sd"> such as integers, floats, and lists. Requires the zero value for the underlying type</span>
<span class="sd"> as a parameter.</span>
<span class="sd"> """</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">zero_value</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">zero_value</span> <span class="o">=</span> <span class="n">zero_value</span>
<span class="k">def</span> <span class="nf">zero</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">zero_value</span>
<span class="k">def</span> <span class="nf">addInPlace</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value1</span><span class="p">,</span> <span class="n">value2</span><span class="p">):</span>
<span class="n">value1</span> <span class="o">+=</span> <span class="n">value2</span>
<span class="k">return</span> <span class="n">value1</span>
<span class="c"># Singleton accumulator params for some standard types</span>
<span class="n">INT_ACCUMULATOR_PARAM</span> <span class="o">=</span> <span class="n">AddingAccumulatorParam</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="n">FLOAT_ACCUMULATOR_PARAM</span> <span class="o">=</span> <span class="n">AddingAccumulatorParam</span><span class="p">(</span><span class="mf">0.0</span><span class="p">)</span>
<span class="n">COMPLEX_ACCUMULATOR_PARAM</span> <span class="o">=</span> <span class="n">AddingAccumulatorParam</span><span class="p">(</span><span class="mf">0.0j</span><span class="p">)</span>
<span class="k">class</span> <span class="nc">_UpdateRequestHandler</span><span class="p">(</span><span class="n">SocketServer</span><span class="o">.</span><span class="n">StreamRequestHandler</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> This handler will keep polling updates from the same socket until the</span>
<span class="sd"> server is shutdown.</span>
<span class="sd"> """</span>
<span class="k">def</span> <span class="nf">handle</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">pyspark.accumulators</span> <span class="kn">import</span> <span class="n">_accumulatorRegistry</span>
<span class="k">while</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">server_shutdown</span><span class="p">:</span>
<span class="c"># Poll every 1 second for new data -- don't block in case of shutdown.</span>
<span class="n">r</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="o">=</span> <span class="n">select</span><span class="o">.</span><span class="n">select</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">rfile</span><span class="p">],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">rfile</span> <span class="ow">in</span> <span class="n">r</span><span class="p">:</span>
<span class="n">num_updates</span> <span class="o">=</span> <span class="n">read_int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">rfile</span><span class="p">)</span>
<span class="k">for</span> <span class="n">_</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">num_updates</span><span class="p">):</span>
<span class="p">(</span><span class="n">aid</span><span class="p">,</span> <span class="n">update</span><span class="p">)</span> <span class="o">=</span> <span class="n">pickleSer</span><span class="o">.</span><span class="n">_read_with_length</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">rfile</span><span class="p">)</span>
<span class="n">_accumulatorRegistry</span><span class="p">[</span><span class="n">aid</span><span class="p">]</span> <span class="o">+=</span> <span class="n">update</span>
<span class="c"># Write a byte in acknowledgement</span>
<span class="bp">self</span><span class="o">.</span><span class="n">wfile</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">struct</span><span class="o">.</span><span class="n">pack</span><span class="p">(</span><span class="s">"!b"</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="k">class</span> <span class="nc">AccumulatorServer</span><span class="p">(</span><span class="n">SocketServer</span><span class="o">.</span><span class="n">TCPServer</span><span class="p">):</span>
<span class="sd">"""</span>
<span class="sd"> A simple TCP server that intercepts shutdown() in order to interrupt</span>
<span class="sd"> our continuous polling on the handler.</span>
<span class="sd"> """</span>
<span class="n">server_shutdown</span> <span class="o">=</span> <span class="bp">False</span>
<span class="k">def</span> <span class="nf">shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server_shutdown</span> <span class="o">=</span> <span class="bp">True</span>
<span class="n">SocketServer</span><span class="o">.</span><span class="n">TCPServer</span><span class="o">.</span><span class="n">shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server_close</span><span class="p">()</span>
<span class="k">def</span> <span class="nf">_start_update_server</span><span class="p">():</span>
<span class="sd">"""Start a TCP server to receive accumulator updates in a daemon thread, and returns it"""</span>
<span class="n">server</span> <span class="o">=</span> <span class="n">AccumulatorServer</span><span class="p">((</span><span class="s">"localhost"</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">_UpdateRequestHandler</span><span class="p">)</span>
<span class="n">thread</span> <span class="o">=</span> <span class="n">threading</span><span class="o">.</span><span class="n">Thread</span><span class="p">(</span><span class="n">target</span><span class="o">=</span><span class="n">server</span><span class="o">.</span><span class="n">serve_forever</span><span class="p">)</span>
<span class="n">thread</span><span class="o">.</span><span class="n">daemon</span> <span class="o">=</span> <span class="bp">True</span>
<span class="n">thread</span><span class="o">.</span><span class="n">start</span><span class="p">()</span>
<span class="k">return</span> <span class="n">server</span>
<span class="k">if</span> <span class="n">__name__</span> <span class="o">==</span> <span class="s">"__main__"</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">doctest</span>
<span class="p">(</span><span class="n">failure_count</span><span class="p">,</span> <span class="n">test_count</span><span class="p">)</span> <span class="o">=</span> <span class="n">doctest</span><span class="o">.</span><span class="n">testmod</span><span class="p">()</span>
<span class="k">if</span> <span class="n">failure_count</span><span class="p">:</span>
<span class="nb">exit</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../index.html">
<img class="logo" src="../../_static/spark-logo-hd.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="../../index.html">PySpark master documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../index.html" >Module code</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright .
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
</div>
</body>
</html>