blob: e592e5f183b1e93b8a537c33fbcfb9d6b82d6ca1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_102) on Fri Nov 25 15:49:40 PST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Union (com.yahoo.datasketches:sketches-pig 0.8.3-SNAPSHOT API)</title>
<meta name="date" content="2016-11-25">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Union (com.yahoo.datasketches:sketches-pig 0.8.3-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Union.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/yahoo/sketches/pig/theta/SketchToString.html" title="class in com.yahoo.sketches.pig.theta"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/yahoo/sketches/pig/theta/Union.Initial.html" title="class in com.yahoo.sketches.pig.theta"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/yahoo/sketches/pig/theta/Union.html" target="_top">Frames</a></li>
<li><a href="Union.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.pig.EvalFunc">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.yahoo.sketches.pig.theta</div>
<h2 title="Class Union" class="title">Class Union</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.pig.EvalFunc&lt;org.apache.pig.data.Tuple&gt;</li>
<li>
<ul class="inheritance">
<li>com.yahoo.sketches.pig.theta.Union</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>org.apache.pig.Accumulator&lt;org.apache.pig.data.Tuple&gt;, org.apache.pig.Algebraic</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Union</span>
extends org.apache.pig.EvalFunc&lt;org.apache.pig.data.Tuple&gt;
implements org.apache.pig.Accumulator&lt;org.apache.pig.data.Tuple&gt;, org.apache.pig.Algebraic</pre>
<div class="block">This is a Pig UDF that performs the Union Set Operation on Sketches.
To assist Pig, this class implements both the <i>Accumulator</i> and <i>Algebraic</i> interfaces.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Lee Rhodes</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.Initial.html" title="class in com.yahoo.sketches.pig.theta">Union.Initial</a></span></code>
<div class="block">Class used to calculate the initial pass of an Algebraic sketch operation.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.IntermediateFinal.html" title="class in com.yahoo.sketches.pig.theta">Union.IntermediateFinal</a></span></code>
<div class="block">Class used to calculate the intermediate or final combiner pass of an <i>Algebraic</i> union
operation.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.pig.EvalFunc">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.pig.EvalFunc</h3>
<code>org.apache.pig.EvalFunc.SchemaType</code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.org.apache.pig.EvalFunc">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.pig.EvalFunc</h3>
<code>log, pigLogger, reporter, returnType</code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#Union--">Union</a></span>()</code>
<div class="block">Default constructor to make pig validation happy.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#Union-int-float-long-">Union</a></span>(int&nbsp;nomEntries,
float&nbsp;p,
long&nbsp;seed)</code>
<div class="block">Base constructor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#Union-java.lang.String-">Union</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr)</code>
<div class="block">String constructor.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#Union-java.lang.String-java.lang.String-">Union</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pStr)</code>
<div class="block">String constructor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#Union-java.lang.String-java.lang.String-java.lang.String-">Union</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;seedStr)</code>
<div class="block">Full string constructor.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#accumulate-org.apache.pig.data.Tuple-">accumulate</a></span>(org.apache.pig.data.Tuple&nbsp;inputTuple)</code>
<div class="block">An <i>Accumulator</i> version of the standard <i>exec()</i> method.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#cleanup--">cleanup</a></span>()</code>
<div class="block">Cleans up the UDF state after being called using the <code>Accumulator</code> interface.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>org.apache.pig.data.Tuple</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#exec-org.apache.pig.data.Tuple-">exec</a></span>(org.apache.pig.data.Tuple&nbsp;inputTuple)</code>
<div class="block">Top-level exec function.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#getFinal--">getFinal</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#getInitial--">getInitial</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#getIntermed--">getIntermed</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>org.apache.pig.data.Tuple</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#getValue--">getValue</a></span>()</code>
<div class="block">Returns the sketch that has been built up by multiple calls to <a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#accumulate-org.apache.pig.data.Tuple-"><code>accumulate(org.apache.pig.data.Tuple)</code></a>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>org.apache.pig.impl.logicalLayer.schema.Schema</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#outputSchema-org.apache.pig.impl.logicalLayer.schema.Schema-">outputSchema</a></span>(org.apache.pig.impl.logicalLayer.schema.Schema&nbsp;input)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.pig.EvalFunc">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.pig.EvalFunc</h3>
<code>allowCompileTimeCalculation, finish, getArgToFuncMapping, getCacheFiles, getInputSchema, getLogger, getPigLogger, getReporter, getReturnType, getSchemaName, getSchemaType, getShipFiles, isAsynchronous, needEndOfAllInputProcessing, progress, setEndOfAllInput, setInputSchema, setPigLogger, setReporter, setUDFContextSignature, warn</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Union--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union()</pre>
<div class="block">Default constructor to make pig validation happy. Assumes:
<ul>
<li><a href="../../../../../resources/dictionary.html#defaultNomEntries">See Default Nominal Entries</a></li>
<li><i>p</i> = 1.0. <a href="../../../../../resources/dictionary.html#p">See Sampling Probability,
<i>p</i></a>.</li>
<li><a href="../../../../../resources/dictionary.html#defaultUpdateSeed">See Default Update Seed</a></li>
</ul></div>
</li>
</ul>
<a name="Union-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr)</pre>
<div class="block">String constructor. Assumes:
<ul>
<li><i>p</i> = 1.0. <a href="../../../../../resources/dictionary.html#p">See Sampling Probability,
<i>p</i></a></li>
<li><a href="../../../../../resources/dictionary.html#defaultUpdateSeed">See Default Update Seed</a></li>
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nomEntriesStr</code> - <a href="../../../../../resources/dictionary.html#nomEntries">See Nominal Entries</a></dd>
</dl>
</li>
</ul>
<a name="Union-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pStr)</pre>
<div class="block">String constructor. Assumes:
<ul>
<li><a href="../../../../../resources/dictionary.html#defaultUpdateSeed">See Default Update Seed</a></li>
</ul></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nomEntriesStr</code> - <a href="../../../../../resources/dictionary.html#nomEntries">See Nominal Entries</a></dd>
<dd><code>pStr</code> - <a href="../../../../../resources/dictionary.html#p">See Sampling Probability, <i>p</i></a>.
Although this functionality is implemented for SketchUnions, it rarely makes sense to use it
here. The proper use of upfront sampling is when building the sketches.</dd>
</dl>
</li>
</ul>
<a name="Union-java.lang.String-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;nomEntriesStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;pStr,
<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;seedStr)</pre>
<div class="block">Full string constructor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nomEntriesStr</code> - <a href="../../../../../resources/dictionary.html#nomEntries">See Nominal Entries</a>.</dd>
<dd><code>pStr</code> - <a href="../../../../../resources/dictionary.html#p">See Sampling Probability, <i>p</i></a>.
Although this functionality is implemented for SketchUnions, it rarely makes sense to use it
here. The proper use of upfront sampling is when building the sketches.</dd>
<dd><code>seedStr</code> - <a href="../../../../../resources/dictionary.html#seed">See Update Hash Seed</a>.</dd>
</dl>
</li>
</ul>
<a name="Union-int-float-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Union</h4>
<pre>public&nbsp;Union(int&nbsp;nomEntries,
float&nbsp;p,
long&nbsp;seed)</pre>
<div class="block">Base constructor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>nomEntries</code> - <a href="../../../../../resources/dictionary.html#nomEntries">See Nominal Entries</a>.</dd>
<dd><code>p</code> - <a href="../../../../../resources/dictionary.html#p">See Sampling Probability, <i>p</i></a>.
Although this functionality is implemented for SketchUnions, it rarely makes sense to use it
here. The proper use of upfront sampling is when building the sketches.</dd>
<dd><code>seed</code> - <a href="../../../../../resources/dictionary.html#seed">See Update Hash Seed</a>.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="exec-org.apache.pig.data.Tuple-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exec</h4>
<pre>public&nbsp;org.apache.pig.data.Tuple&nbsp;exec(org.apache.pig.data.Tuple&nbsp;inputTuple)
throws <a href="http://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Top-level exec function.
This method accepts an input Tuple containing a Bag of one or more inner <b>Sketch Tuples</b>
and returns a single updated <b>Sketch</b> as a <b>Sketch Tuple</b>.
<p>If a large number of calls are anticipated, leveraging either the <i>Algebraic</i> or
<i>Accumulator</i> interfaces is recommended. Pig normally handles this automatically.
<p>Internally, this method presents the inner <b>Sketch Tuples</b> to a new <b>Union</b>.
The result is returned as a <b>Sketch Tuple</b>
<p><b>Input Tuple</b>
<ul>
<li>Tuple: TUPLE (Must contain only one field)
<ul>
<li>index 0: DataBag: BAG (May contain 0 or more Inner Tuples)
<ul>
<li>index 0: Tuple: TUPLE <b>Sketch Tuple</b></li>
<li>...</li>
<li>index n-1: Tuple: TUPLE <b>Sketch Tuple</b></li>
</ul>
</li>
</ul>
</li>
</ul>
<b>Sketch Tuple</b>
<ul>
<li>Tuple: TUPLE (Contains exactly 1 field)
<ul>
<li>index 0: DataByteArray: BYTEARRAY = The serialization of a Sketch object.</li>
</ul>
</li>
</ul></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>exec</code>&nbsp;in class&nbsp;<code>org.apache.pig.EvalFunc&lt;org.apache.pig.data.Tuple&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputTuple</code> - A tuple containing a single bag, containing Sketch Tuples.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Sketch Tuple. If inputTuple is null or empty, returns empty sketch (8 bytes).</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd>"org.apache.pig.EvalFunc.exec(org.apache.pig.data.Tuple)"</dd>
</dl>
</li>
</ul>
<a name="outputSchema-org.apache.pig.impl.logicalLayer.schema.Schema-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>outputSchema</h4>
<pre>public&nbsp;org.apache.pig.impl.logicalLayer.schema.Schema&nbsp;outputSchema(org.apache.pig.impl.logicalLayer.schema.Schema&nbsp;input)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>outputSchema</code>&nbsp;in class&nbsp;<code>org.apache.pig.EvalFunc&lt;org.apache.pig.data.Tuple&gt;</code></dd>
</dl>
</li>
</ul>
<a name="accumulate-org.apache.pig.data.Tuple-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accumulate</h4>
<pre>public&nbsp;void&nbsp;accumulate(org.apache.pig.data.Tuple&nbsp;inputTuple)
throws <a href="http://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">An <i>Accumulator</i> version of the standard <i>exec()</i> method. Like <i>exec()</i>,
accumulator is called with a bag of Sketch Tuples. Unlike <i>exec()</i>, it doesn't serialize the
sketch at the end. Instead, it can be called multiple times, each time with another bag of
Sketch Tuples to be input to the Union.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>accumulate</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Accumulator&lt;org.apache.pig.data.Tuple&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>inputTuple</code> - A tuple containing a single bag, containing Sketch Tuples.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - by Pig</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#exec-org.apache.pig.data.Tuple-"><code>exec(org.apache.pig.data.Tuple)</code></a>,
"org.apache.pig.Accumulator.accumulate(org.apache.pig.data.Tuple)"</dd>
</dl>
</li>
</ul>
<a name="getValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValue</h4>
<pre>public&nbsp;org.apache.pig.data.Tuple&nbsp;getValue()</pre>
<div class="block">Returns the sketch that has been built up by multiple calls to <a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#accumulate-org.apache.pig.data.Tuple-"><code>accumulate(org.apache.pig.data.Tuple)</code></a>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getValue</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Accumulator&lt;org.apache.pig.data.Tuple&gt;</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Sketch Tuple. (see <a href="../../../../../com/yahoo/sketches/pig/theta/Union.html#exec-org.apache.pig.data.Tuple-"><code>exec(org.apache.pig.data.Tuple)</code></a> for return tuple format)</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd>"org.apache.pig.Accumulator.getValue()"</dd>
</dl>
</li>
</ul>
<a name="cleanup--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cleanup</h4>
<pre>public&nbsp;void&nbsp;cleanup()</pre>
<div class="block">Cleans up the UDF state after being called using the <code>Accumulator</code> interface.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>cleanup</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Accumulator&lt;org.apache.pig.data.Tuple&gt;</code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd>"org.apache.pig.Accumulator.cleanup()"</dd>
</dl>
</li>
</ul>
<a name="getInitial--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInitial</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getInitial()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getInitial</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Algebraic</code></dd>
</dl>
</li>
</ul>
<a name="getIntermed--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIntermed</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getIntermed()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getIntermed</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Algebraic</code></dd>
</dl>
</li>
</ul>
<a name="getFinal--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getFinal</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getFinal()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>getFinal</code>&nbsp;in interface&nbsp;<code>org.apache.pig.Algebraic</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Union.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/yahoo/sketches/pig/theta/SketchToString.html" title="class in com.yahoo.sketches.pig.theta"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../com/yahoo/sketches/pig/theta/Union.Initial.html" title="class in com.yahoo.sketches.pig.theta"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/yahoo/sketches/pig/theta/Union.html" target="_top">Frames</a></li>
<li><a href="Union.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.pig.EvalFunc">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2015&#x2013;2016 <a href="https://www.yahoo.com">Yahoo! Inc.</a>. All rights reserved.</small></p>
</body>
</html>