blob: 381d1758c82d2c0f9e85a67b39e6905936334f35 [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 -->
<title>MapValues (Apache Beam 2.38.0-SNAPSHOT)</title>
<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="MapValues (Apache Beam 2.38.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":9,"i4":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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="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="../../../../../org/apache/beam/sdk/transforms/MapKeys.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/transforms/Materialization.html" title="interface in org.apache.beam.sdk.transforms"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/transforms/MapValues.html" target="_top">Frames</a></li>
<li><a href="MapValues.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.beam.sdk.transforms.PTransform">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&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">org.apache.beam.sdk.transforms</div>
<h2 title="Class MapValues" class="title">Class MapValues&lt;K,V1,V2&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">org.apache.beam.sdk.transforms.PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V1&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V2&gt;&gt;&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.transforms.MapValues&lt;K,V1,V2&gt;</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>V1</code> - the type of the values in the input <code>PCollection</code></dd>
<dd><code>V2</code> - the type of the elements in the output <code>PCollection</code></dd>
</dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, <a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display">HasDisplayData</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">MapValues&lt;K,V1,V2&gt;</span>
extends <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V1&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;K,V2&gt;&gt;&gt;</pre>
<div class="block"><code>MapValues</code> maps a <code>SerializableFunction&lt;V1,V2&gt;</code> over values of a <code>PCollection&lt;KV&lt;K,V1&gt;&gt;</code> and returns a <code>PCollection&lt;KV&lt;K, V2&gt;&gt;</code>.
<p>Example of use:
<pre><code>
PCollection&lt;KV&lt;String, Integer&gt;&gt; input = ...;
PCollection&lt;KV&lt;String, Double&gt; output =
input.apply(MapValues.into(TypeDescriptors.doubles()).via(Integer::doubleValue));
</code></pre>
<p>See also <a href="../../../../../org/apache/beam/sdk/transforms/MapKeys.html" title="class in org.apache.beam.sdk.transforms"><code>MapKeys</code></a>.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../serialized-form.html#org.apache.beam.sdk.transforms.MapValues">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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.beam.sdk.transforms.PTransform">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.beam.sdk.transforms.<a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#name">name</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#resourceHints">resourceHints</a></code></li>
</ul>
</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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>&lt;FailureT&gt;&nbsp;org.apache.beam.sdk.transforms.SimpleMapWithFailures&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;,<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;,FailureT&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#exceptionsInto-org.apache.beam.sdk.values.TypeDescriptor-">exceptionsInto</a></span>(<a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a>&lt;FailureT&gt;&nbsp;failureTypeDescriptor)</code>
<div class="block">Returns a new <code>SimpleMapWithFailures</code> transform that catches exceptions raised while
mapping elements, with the given type descriptor used for the failure collection but the
exception handler yet to be specified using <code>SimpleMapWithFailures.exceptionsVia(ProcessFunction)</code>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>&lt;FailureT&gt;&nbsp;org.apache.beam.sdk.transforms.SimpleMapWithFailures&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;,<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;,FailureT&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#exceptionsVia-org.apache.beam.sdk.transforms.InferableFunction-">exceptionsVia</a></span>(<a href="../../../../../org/apache/beam/sdk/transforms/InferableFunction.html" title="class in org.apache.beam.sdk.transforms">InferableFunction</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.ExceptionElement.html" title="class in org.apache.beam.sdk.transforms">WithFailures.ExceptionElement</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;&gt;,FailureT&gt;&nbsp;exceptionHandler)</code>
<div class="block">Returns a new <code>SimpleMapWithFailures</code> transform that catches exceptions raised while
mapping elements, passing the raised exception instance and the input element being processed
through the given <code>exceptionHandler</code> and emitting the result to a failure collection.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#expand-org.apache.beam.sdk.values.PCollection-">expand</a></span>(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;&gt;&nbsp;input)</code>
<div class="block">Override this method to specify how this <code>PTransform</code> should be expanded on the given
<code>InputT</code>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static &lt;V2&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms">MapValues</a>&lt;?,?,V2&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#into-org.apache.beam.sdk.values.TypeDescriptor-">into</a></span>(<a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a>&lt;V2&gt;&nbsp;outputType)</code>
<div class="block">Returns a new <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms"><code>MapValues</code></a> transform with the given type descriptor for the output type,
but the mapping function yet to be specified using <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#via-org.apache.beam.sdk.transforms.SerializableFunction-"><code>via(SerializableFunction)</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>&lt;NewKeyT,NewValueT&gt;<br><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms">MapValues</a>&lt;NewKeyT,NewValueT,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#via-org.apache.beam.sdk.transforms.SerializableFunction-">via</a></span>(<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;NewValueT,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&nbsp;fn)</code>
<div class="block">Returns a <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms"><code>MapValues</code></a> transform for a <code>ProcessFunction&lt;NewV1, V2&gt;</code> with predefined
<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#outputType"><code>outputType</code></a>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.transforms.PTransform">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.sdk.transforms.<a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#compose-org.apache.beam.sdk.transforms.SerializableFunction-">compose</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#compose-java.lang.String-org.apache.beam.sdk.transforms.SerializableFunction-">compose</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getAdditionalInputs--">getAdditionalInputs</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder--">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder-InputT-">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getDefaultOutputCoder-InputT-org.apache.beam.sdk.values.PCollection-">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getKindString--">getKindString</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getName--">getName</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#getResourceHints--">getResourceHints</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#setResourceHints-org.apache.beam.sdk.transforms.resourcehints.ResourceHints-">setResourceHints</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#toString--">toString</a>, <a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#validate-org.apache.beam.sdk.options.PipelineOptions-">validate</a></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.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="via-org.apache.beam.sdk.transforms.SerializableFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>via</h4>
<pre>public&nbsp;&lt;NewKeyT,NewValueT&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms">MapValues</a>&lt;NewKeyT,NewValueT,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&nbsp;via(<a href="../../../../../org/apache/beam/sdk/transforms/SerializableFunction.html" title="interface in org.apache.beam.sdk.transforms">SerializableFunction</a>&lt;NewValueT,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&nbsp;fn)</pre>
<div class="block">Returns a <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms"><code>MapValues</code></a> transform for a <code>ProcessFunction&lt;NewV1, V2&gt;</code> with predefined
<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#outputType"><code>outputType</code></a>.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>NewKeyT</code> - the type of the keys in the input and output <code>PCollection</code>s</dd>
<dd><code>NewValueT</code> - the type of the values in the input <code>PCollection</code></dd>
</dl>
</li>
</ul>
<a name="into-org.apache.beam.sdk.values.TypeDescriptor-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>into</h4>
<pre>public static&nbsp;&lt;V2&gt;&nbsp;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms">MapValues</a>&lt;?,?,V2&gt;&nbsp;into(<a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a>&lt;V2&gt;&nbsp;outputType)</pre>
<div class="block">Returns a new <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="class in org.apache.beam.sdk.transforms"><code>MapValues</code></a> transform with the given type descriptor for the output type,
but the mapping function yet to be specified using <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#via-org.apache.beam.sdk.transforms.SerializableFunction-"><code>via(SerializableFunction)</code></a>.</div>
</li>
</ul>
<a name="exceptionsInto-org.apache.beam.sdk.values.TypeDescriptor-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exceptionsInto</h4>
<pre><a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/RequiresNonNull.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@RequiresNonNull</a>(<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/RequiresNonNull.html?is-external=true#value--" title="class or interface in org.checkerframework.checker.nullness.qual">value</a>="fn")
public&nbsp;&lt;FailureT&gt;&nbsp;org.apache.beam.sdk.transforms.SimpleMapWithFailures&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;,<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;,FailureT&gt;&nbsp;exceptionsInto(<a href="../../../../../org/apache/beam/sdk/values/TypeDescriptor.html" title="class in org.apache.beam.sdk.values">TypeDescriptor</a>&lt;FailureT&gt;&nbsp;failureTypeDescriptor)</pre>
<div class="block">Returns a new <code>SimpleMapWithFailures</code> transform that catches exceptions raised while
mapping elements, with the given type descriptor used for the failure collection but the
exception handler yet to be specified using <code>SimpleMapWithFailures.exceptionsVia(ProcessFunction)</code>.
<p>See <a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.html" title="class in org.apache.beam.sdk.transforms"><code>WithFailures</code></a> documentation for usage patterns of the returned <a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.Result.html" title="class in org.apache.beam.sdk.transforms"><code>WithFailures.Result</code></a>.
<p>Example usage:
<pre><code>
Result&lt;PCollection&lt;KV&lt;String, Integer&gt;&gt;, String&gt; result =
input.apply(
MapValues.into(TypeDescriptors.integers())
.&lt;String, String&gt;via(word -&gt; 1 / word.length) // Could throw ArithmeticException
.exceptionsInto(TypeDescriptors.strings())
.exceptionsVia(ee -&gt; ee.exception().getMessage()));
PCollection&lt;KV&lt;String, Integer&gt;&gt; output = result.output();
PCollection&lt;String&gt; failures = result.failures();
</code></pre></div>
</li>
</ul>
<a name="exceptionsVia-org.apache.beam.sdk.transforms.InferableFunction-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exceptionsVia</h4>
<pre><a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/RequiresNonNull.html?is-external=true" title="class or interface in org.checkerframework.checker.nullness.qual">@RequiresNonNull</a>(<a href="https://static.javadoc.io/org.checkerframework/checker-qual/3.10.0/org/checkerframework/checker/nullness/qual/RequiresNonNull.html?is-external=true#value--" title="class or interface in org.checkerframework.checker.nullness.qual">value</a>="fn")
public&nbsp;&lt;FailureT&gt;&nbsp;org.apache.beam.sdk.transforms.SimpleMapWithFailures&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;,<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;,FailureT&gt;&nbsp;exceptionsVia(<a href="../../../../../org/apache/beam/sdk/transforms/InferableFunction.html" title="class in org.apache.beam.sdk.transforms">InferableFunction</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.ExceptionElement.html" title="class in org.apache.beam.sdk.transforms">WithFailures.ExceptionElement</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;&gt;,FailureT&gt;&nbsp;exceptionHandler)</pre>
<div class="block">Returns a new <code>SimpleMapWithFailures</code> transform that catches exceptions raised while
mapping elements, passing the raised exception instance and the input element being processed
through the given <code>exceptionHandler</code> and emitting the result to a failure collection.
<p>This method takes advantage of the type information provided by <a href="../../../../../org/apache/beam/sdk/transforms/InferableFunction.html" title="class in org.apache.beam.sdk.transforms"><code>InferableFunction</code></a>,
meaning that a call to <a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html#exceptionsInto-org.apache.beam.sdk.values.TypeDescriptor-"><code>exceptionsInto(TypeDescriptor)</code></a> may not be necessary.
<p>See <a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.html" title="class in org.apache.beam.sdk.transforms"><code>WithFailures</code></a> documentation for usage patterns of the returned <a href="../../../../../org/apache/beam/sdk/transforms/WithFailures.Result.html" title="class in org.apache.beam.sdk.transforms"><code>WithFailures.Result</code></a>.
<p>Example usage:
<pre>{@code
Result<PCollection<KV<String, Integer>>, String> result =
input.apply(
MapValues.into(TypeDescriptors.integers())
.<String, String>via(word -> 1 / word.length) // Could throw ArithmeticException
.exceptionsVia(
new InferableFunction<ExceptionElement<KV<String, String>>, String>() {</div>
</li>
</ul>
<a name="expand-org.apache.beam.sdk.values.PCollection-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>expand</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&gt;&nbsp;expand(<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;&gt;&nbsp;input)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#expand-InputT-">PTransform</a></code></span></div>
<div class="block">Override this method to specify how this <code>PTransform</code> should be expanded on the given
<code>InputT</code>.
<p>NOTE: This method should not be called directly. Instead apply the <code>PTransform</code> should
be applied to the <code>InputT</code> using the <code>apply</code> method.
<p>Composite transforms, which are defined in terms of other transforms, should return the
output of one of the composed transforms. Non-composite transforms, which do not apply any
transforms internally, should return a new unbound output and register evaluators (via
backend-specific registration methods).</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html#expand-InputT-">expand</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/PTransform.html" title="class in org.apache.beam.sdk.transforms">PTransform</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V1</a>&gt;&gt;,<a href="../../../../../org/apache/beam/sdk/values/PCollection.html" title="class in org.apache.beam.sdk.values">PCollection</a>&lt;<a href="../../../../../org/apache/beam/sdk/values/KV.html" title="class in org.apache.beam.sdk.values">KV</a>&lt;<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">K</a>,<a href="../../../../../org/apache/beam/sdk/transforms/MapValues.html" title="type parameter in MapValues">V2</a>&gt;&gt;&gt;</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="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="../../../../../org/apache/beam/sdk/transforms/MapKeys.html" title="class in org.apache.beam.sdk.transforms"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/transforms/Materialization.html" title="interface in org.apache.beam.sdk.transforms"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/transforms/MapValues.html" target="_top">Frames</a></li>
<li><a href="MapValues.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>Nested&nbsp;|&nbsp;</li>
<li><a href="#fields.inherited.from.class.org.apache.beam.sdk.transforms.PTransform">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>