This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 52db1c3  Publishing website 2020/10/08 00:03:51 at commit f338284
52db1c3 is described below

commit 52db1c38dd087035a40b31cf9c91522cd016df76
Author: jenkins <[email protected]>
AuthorDate: Thu Oct 8 00:03:51 2020 +0000

    Publishing website 2020/10/08 00:03:51 at commit f338284
---
 website/generated-content/documentation/index.xml  | 94 ++++++++++++++++------
 .../documentation/programming-guide/index.html     | 72 ++++++++++++-----
 website/generated-content/sitemap.xml              |  2 +-
 3 files changed, 125 insertions(+), 43 deletions(-)

diff --git a/website/generated-content/documentation/index.xml 
b/website/generated-content/documentation/index.xml
index 6aab1a5..cb772ab 100644
--- a/website/generated-content/documentation/index.xml
+++ b/website/generated-content/documentation/index.xml
@@ -3198,7 +3198,7 @@ elements from the input collection).&lt;/li>
 &lt;li>Once you output a value using 
&lt;code>OutputReceiver.output()&lt;/code> you should not modify
 that value in any way.&lt;/li>
 &lt;/ul>&lt;/p>
-&lt;p class="language-python">&lt;ul>
+&lt;p class="language-py">&lt;ul>
 &lt;li>You should not in any way modify the &lt;code>element&lt;/code> 
argument provided to the
 &lt;code>process&lt;/code> method, or any side inputs.&lt;/li>
 &lt;li>Once you output a value using &lt;code>yield&lt;/code> or 
&lt;code>return&lt;/code>, you should not modify
@@ -4529,6 +4529,7 @@ of the Beam SDK being used. This allows Beam users to 
continue using native type
 having Beam understand their element schemas.&lt;/p>
 &lt;p class="language-java">In Java you could use the following set of classes 
to represent the purchase schema. Beam will automatically
 infer the correct schema based on the members of the class.&lt;/p>
+&lt;p class="language-py">In Python you can use the following set of classes 
to represent the purchase schema. Beam will automatically infer the correct 
schema based on the members of the class.&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="nd">@DefaultSchema&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">JavaBeanSchema&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">class&lt;/span>&lt;span class="o">)&lt;/span>
 &lt;span class="kd">public&lt;/span> &lt;span class="kd">class&lt;/span> 
&lt;span class="nc">Purchase&lt;/span> &lt;span class="o">{&lt;/span>
@@ -4567,7 +4568,25 @@ infer the correct schema based on the members of the 
class.&lt;/p>
 &lt;span class="o">}&lt;/span>
 &lt;span class="o">}&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>Using JavaBean classes as above is one way to map a schema to Java 
classes. However multiple Java classes might have
+&lt;div class=language-py>
+&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-py" 
data-lang="py">&lt;span class="kn">import&lt;/span> &lt;span 
class="nn">typing&lt;/span>
+&lt;span class="k">class&lt;/span> &lt;span 
class="nc">Purchase&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">NamedTuple&lt;/span>&lt;span class="p">):&lt;/span>
+&lt;span class="n">user_id&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">str&lt;/span> &lt;span class="c1"># The id of the user who made the 
purchase.&lt;/span>
+&lt;span class="n">item_id&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">int&lt;/span> &lt;span class="c1"># The identifier of the item that 
was purchased.&lt;/span>
+&lt;span class="n">shipping_address&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="n">ShippingAddress&lt;/span> &lt;span class="c1"># The shipping 
address, a nested type.&lt;/span>
+&lt;span class="n">cost_cents&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">int&lt;/span> &lt;span class="c1"># The cost of the item&lt;/span>
+&lt;span class="n">transactions&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">Sequence&lt;/span>&lt;span class="p">[&lt;/span>&lt;span 
class="n">Transaction&lt;/span>&lt;span class="p">]&lt;/span> &lt;span 
class="c1"># The transactions that paid for this purchase (a list, since the 
purchase might be spread out over multiple credit cards).&lt;/span>
+&lt;span class="k">class&lt;/span> &lt;span 
class="nc">ShippingAddress&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">NamedTuple&lt;/span>&lt;span class="p">):&lt;/span>
+&lt;span class="n">street_address&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="nb">str&lt;/span>
+&lt;span class="n">city&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">str&lt;/span>
+&lt;span class="n">state&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">Optional&lt;/span>&lt;span class="p">[&lt;/span>&lt;span 
class="nb">str&lt;/span>&lt;span class="p">]&lt;/span>
+&lt;span class="n">country&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">str&lt;/span>
+&lt;span class="n">postal_code&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="nb">str&lt;/span>
+&lt;span class="k">class&lt;/span> &lt;span 
class="nc">Transaction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">NamedTuple&lt;/span>&lt;span class="p">):&lt;/span>
+&lt;span class="n">bank&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">str&lt;/span>
+&lt;span class="n">purchase_amount&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="nb">float&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
+&lt;/div>
+&lt;p class="language-java">Using JavaBean classes as above is one way to map 
a schema to Java classes. However multiple Java classes might have
 the same schema, in which case the different Java types can often be used 
interchangeably. Beam will add implicit
 conversions between types that have matching schemas. For example, the above
 &lt;code>Transaction&lt;/code> class has the same schema as the following 
class:&lt;/p>
@@ -4578,12 +4597,12 @@ conversions between types that have matching schemas. 
For example, the above
 &lt;span class="kd">public&lt;/span> &lt;span class="kt">double&lt;/span> 
&lt;span class="n">purchaseAmount&lt;/span>&lt;span class="o">;&lt;/span>
 &lt;span class="o">}&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>So if we had two &lt;code>PCollection&lt;/code>s as follows&lt;/p>
+&lt;p class="language-java">So if we had two &lt;code>PCollection&lt;/code>s 
as follows&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="n">PCollection&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span 
class="n">Transaction&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> &lt;span 
class="n">transactionBeans&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="n">readTransactionsAsJavaBean&lt;/span>&lt;span class="o">();&lt;/span>
 &lt;span class="n">PCollection&lt;/span>&lt;span 
class="o">&amp;lt;&lt;/span>&lt;span 
class="n">TransactionPojos&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> 
&lt;span class="n">transactionPojos&lt;/span> &lt;span class="o">=&lt;/span> 
&lt;span class="n">readTransactionsAsPojo&lt;/span>&lt;span 
class="o">();&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>Then these two &lt;code>PCollection&lt;/code>s would have the same 
schema, even though their Java types would be different. This means
+&lt;p class="language-java">Then these two &lt;code>PCollection&lt;/code>s 
would have the same schema, even though their Java types would be different. 
This means
 for example the following two code snippets are valid:&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="n">transactionBeans&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">apply&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">ParDo&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">of&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="k">new&lt;/span> &lt;span class="n">DoFn&lt;/span>&lt;span 
class="o">&amp;lt;...&amp;gt;()&lt;/span> &lt;span cla [...]
@@ -4592,15 +4611,14 @@ for example the following two code snippets are 
valid:&lt;/p>
 &lt;span class="o">}&lt;/span>
 &lt;span class="o">}));&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>and
+&lt;p class="language-java">and&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="n">transactionPojos&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">apply&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">ParDo&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">of&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="k">new&lt;/span> &lt;span class="n">DoFn&lt;/span>&lt;span 
class="o">&amp;lt;...&amp;gt;()&lt;/span> &lt;span cla [...]
 &lt;span class="nd">@ProcessElement&lt;/span> &lt;span 
class="kd">public&lt;/span> &lt;span class="kt">void&lt;/span> &lt;span 
class="nf">process&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="nd">@Element&lt;/span> &lt;span class="n">Transaction&lt;/span> &lt;span 
class="n">row&lt;/span>&lt;span class="o">)&lt;/span> &lt;span 
class="o">{&lt;/span>
 &lt;span class="o">}&lt;/span>
 &lt;span class="o">}));&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;/p>
-&lt;p>Even though the in both cases the &lt;code>@Element&lt;/code> parameter 
differs from the the &lt;code>PCollection&lt;/code>'s Java type, since the
+&lt;p class="language-java">Even though the in both cases the 
&lt;code>@Element&lt;/code> parameter differs from the the 
&lt;code>PCollection&lt;/code>'s Java type, since the
 schemas are the same Beam will automatically make the conversion. The built-in 
&lt;code>Convert&lt;/code> transform can also be used
 to translate between Java types of equivalent schemas, as detailed 
below.&lt;/p>
 &lt;h3 id="schema-definition">6.3. Schema definition&lt;/h3>
@@ -4771,13 +4789,13 @@ also be used.&lt;/p>
 &lt;p>In order to take advantage of schemas, your 
&lt;code>PCollection&lt;/code>s must have a schema attached to it. Often, the 
source itself will attach a schema to the PCollection. For example, when using 
&lt;code>AvroIO&lt;/code> to read Avro files, the source can automatically 
infer a Beam schema from the Avro schema and attach that to the Beam 
&lt;code>PCollection&lt;/code>. However not all sources produce schemas. In 
addition, often Beam pipelines have intermediate stages and types [...]
 &lt;h4 id="inferring-schemas">6.5.1. Inferring schemas&lt;/h4>
 &lt;p class="language-java">Beam is able to infer schemas from a variety of 
common Java types. The &lt;code>@DefaultSchema&lt;/code> annotation can be used 
to tell Beam to infer schemas from a specific type. The annotation takes a 
&lt;code>SchemaProvider&lt;/code> as an argument, and 
&lt;code>SchemaProvider&lt;/code> classes are already built in for common Java 
types. The &lt;code>SchemaRegistry&lt;/code> can also be invoked 
programmatically for cases where it is not practical to annotat [...]
-&lt;h5 id="java-pojos">&lt;strong>Java POJOs&lt;/strong>&lt;/h5>
-&lt;p>A POJO (Plain Old Java Object) is a Java object that is not bound by any 
restriction other than the Java Language
+&lt;p class="language-java">&lt;strong>Java POJOs&lt;/strong>&lt;/p>
+&lt;p class="language-java">A POJO (Plain Old Java Object) is a Java object 
that is not bound by any restriction other than the Java Language
 Specification. A POJO can contain member variables that are primitives, that 
are other POJOs, or are collections maps or
 arrays thereof. POJOs do not have to extend prespecified classes or extend any 
specific interfaces.&lt;/p>
-&lt;p>If a POJO class is annotated with 
&lt;code>@DefaultSchema(JavaFieldSchema.class)&lt;/code>, Beam will 
automatically infer a schema for
+&lt;p class="language-java">If a POJO class is annotated with 
&lt;code>@DefaultSchema(JavaFieldSchema.class)&lt;/code>, Beam will 
automatically infer a schema for
 this class. Nested classes are supported as are classes with 
&lt;code>List&lt;/code>, array, and &lt;code>Map&lt;/code> fields.&lt;/p>
-&lt;p>For example, annotating the following class tells Beam to infer a schema 
from this POJO class and apply it to any
+&lt;p class="language-java">For example, annotating the following class tells 
Beam to infer a schema from this POJO class and apply it to any
 &lt;code>PCollection&amp;lt;TransactionPojo&amp;gt;&lt;/code>.&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="nd">@DefaultSchema&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">JavaFieldSchema&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">class&lt;/span>&lt;span class="o">)&lt;/span>
@@ -4793,24 +4811,24 @@ this class. Nested classes are supported as are classes 
with &lt;code>List&lt;/c
 &lt;span class="c1">// Beam will automatically infer the correct schema for 
this PCollection. No coder is needed as a result.
 &lt;/span>&lt;span class="c1">&lt;/span>&lt;span 
class="n">PCollection&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span 
class="n">TransactionPojo&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> 
&lt;span class="n">pojos&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="n">readPojos&lt;/span>&lt;span 
class="o">();&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>The &lt;code>@SchemaCreate&lt;/code> annotation tells Beam that this 
constructor can be used to create instances of TransactionPojo,
+&lt;p class="language-java">The &lt;code>@SchemaCreate&lt;/code> annotation 
tells Beam that this constructor can be used to create instances of 
TransactionPojo,
 assuming that constructor parameters have the same names as the field names. 
&lt;code>@SchemaCreate&lt;/code> can also be used to annotate
 static factory methods on the class, allowing the constructor to remain 
private. If there is no &lt;code>@SchemaCreate&lt;/code>
 annotation then all the fields must be non-final and the class must have a 
zero-argument constructor.&lt;/p>
-&lt;p>There are a couple of other useful annotations that affect how Beam 
infers schemas. By default the schema field names
+&lt;p class="language-java">There are a couple of other useful annotations 
that affect how Beam infers schemas. By default the schema field names
 inferred will match that of the class field names. However 
&lt;code>@SchemaFieldName&lt;/code> can be used to specify a different name to
 be used for the schema field. &lt;code>@SchemaIgnore&lt;/code> can be used to 
mark specific class fields as excluded from the inferred
 schema. For example, it’s common to have ephemeral fields in a class that 
should not be included in a schema
 (e.g. caching the hash value to prevent expensive recomputation of the hash), 
and &lt;code>@SchemaIgnore&lt;/code> can be used to
 exclude these fields. Note that ignored fields will not be included in the 
encoding of these records.&lt;/p>
-&lt;p>In some cases it is not convenient to annotate the POJO class, for 
example if the POJO is in a different package that is
+&lt;p class="language-java">In some cases it is not convenient to annotate the 
POJO class, for example if the POJO is in a different package that is
 not owned by the Beam pipeline author. In these cases the schema inference can 
be triggered programmatically in
 pipeline’s main function as follows:&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java"> &lt;span 
class="n">pipeline&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">getSchemaRegistry&lt;/span>&lt;span class="o">().&lt;/span>&lt;span 
class="na">registerPOJO&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">TransactionPOJO&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">class&lt;/span>&lt;span 
class="o">);&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;h5 id="java-beans">&lt;strong>Java Beans&lt;/strong>&lt;/h5>
-&lt;p>Java Beans are a de-facto standard for creating reusable property 
classes in Java. While the full
+&lt;p class="language-java">&lt;strong>Java Beans&lt;/strong>&lt;/p>
+&lt;p class="language-java">Java Beans are a de-facto standard for creating 
reusable property classes in Java. While the full
 standard has many characteristics, the key ones are that all properties are 
accessed via getter and setter classes, and
 the name format for these getters and setters is standardized. A Java Bean 
class can be annotated with
 &lt;code>@DefaultSchema(JavaBeanSchema.class)&lt;/code> and Beam will 
automatically infer a schema for this class. For example:&lt;/p>
@@ -4826,7 +4844,7 @@ the name format for these getters and setters is 
standardized. A Java Bean class
 &lt;span class="c1">// Beam will automatically infer the correct schema for 
this PCollection. No coder is needed as a result.
 &lt;/span>&lt;span class="c1">&lt;/span>&lt;span 
class="n">PCollection&lt;/span>&lt;span class="o">&amp;lt;&lt;/span>&lt;span 
class="n">TransactionBean&lt;/span>&lt;span class="o">&amp;gt;&lt;/span> 
&lt;span class="n">beans&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="n">readBeans&lt;/span>&lt;span 
class="o">();&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>The &lt;code>@SchemaCreate&lt;/code> annotation can be used to specify a 
constructor or a static factory method, in which case the
+&lt;p class="language-java">The &lt;code>@SchemaCreate&lt;/code> annotation 
can be used to specify a constructor or a static factory method, in which case 
the
 setters and zero-argument constructor can be omitted.&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="nd">@DefaultSchema&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">JavaBeanSchema&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">class&lt;/span>&lt;span class="o">)&lt;/span>
@@ -4837,12 +4855,12 @@ setters and zero-argument constructor can be 
omitted.&lt;/p>
 &lt;span class="kd">public&lt;/span> &lt;span class="kt">double&lt;/span> 
&lt;span class="nf">getPurchaseAmount&lt;/span>&lt;span class="o">()&lt;/span> 
&lt;span class="o">{&lt;/span> &lt;span class="err">…&lt;/span> &lt;span 
class="o">}&lt;/span>
 &lt;span class="o">}&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>&lt;code>@SchemaFieldName&lt;/code> and &lt;code>@SchemaIgnore&lt;/code> 
can be used to alter the schema inferred, just like with POJO classes.&lt;/p>
-&lt;h5 id="autovalue">&lt;strong>AutoValue&lt;/strong>&lt;/h5>
-&lt;p>Java value classes are notoriously difficult to generate correctly. 
There is a lot of boilerplate you must create in
+&lt;p class="language-java">&lt;code>@SchemaFieldName&lt;/code> and 
&lt;code>@SchemaIgnore&lt;/code> can be used to alter the schema inferred, just 
like with POJO classes.&lt;/p>
+&lt;p class="language-java">&lt;strong>AutoValue&lt;/strong>&lt;/p>
+&lt;p class="language-java">Java value classes are notoriously difficult to 
generate correctly. There is a lot of boilerplate you must create in
 order to properly implement a value class. AutoValue is a popular library for 
easily generating such classes by
 implementing a simple abstract base class.&lt;/p>
-&lt;p>Beam can infer a schema from an AutoValue class. For example:&lt;/p>
+&lt;p class="language-java">Beam can infer a schema from an AutoValue class. 
For example:&lt;/p>
 &lt;div class=language-java>
 &lt;div class="highlight">&lt;pre class="chroma">&lt;code 
class="language-java" data-lang="java">&lt;span 
class="nd">@DefaultSchema&lt;/span>&lt;span class="o">(&lt;/span>&lt;span 
class="n">AutoValueSchema&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="na">class&lt;/span>&lt;span class="o">)&lt;/span>
 &lt;span class="nd">@AutoValue&lt;/span>
@@ -4851,9 +4869,39 @@ implementing a simple abstract base class.&lt;/p>
 &lt;span class="kd">public&lt;/span> &lt;span class="kd">abstract&lt;/span> 
&lt;span class="kt">double&lt;/span> &lt;span 
class="nf">getPurchaseAmount&lt;/span>&lt;span class="o">();&lt;/span>
 &lt;span class="o">}&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
-&lt;p>This is all that’s needed to generate a simple AutoValue class, and the 
above &lt;code>@DefaultSchema&lt;/code> annotation tells Beam to
+&lt;p class="language-java">This is all that’s needed to generate a simple 
AutoValue class, and the above &lt;code>@DefaultSchema&lt;/code> annotation 
tells Beam to
 infer a schema from it. This also allows AutoValue elements to be used inside 
of &lt;code>PCollection&lt;/code>s.&lt;/p>
-&lt;p>&lt;code>@SchemaFieldName&lt;/code> and &lt;code>@SchemaIgnore&lt;/code> 
can be used to alter the schema inferred.&lt;/p>
+&lt;p class="language-java">&lt;code>@SchemaFieldName&lt;/code> and 
&lt;code>@SchemaIgnore&lt;/code> can be used to alter the schema 
inferred.&lt;/p>
+&lt;p class="language-py">Beam has a few different mechanisms for inferring 
schemas from Python code.&lt;/p>
+&lt;p class="language-py">&lt;strong>NamedTuple classes&lt;/strong>&lt;/p>
+&lt;p class="language-py">A &lt;a 
href="https://docs.python.org/3/library/typing.html#typing.NamedTuple";>NamedTuple&lt;/a>
+class is a Python class that wraps a &lt;code>tuple&lt;/code>, assigning a 
name to each element
+and restricting it to a particular type. Beam will automatically infer the
+schema for PCollections with &lt;code>NamedTuple&lt;/code> output types. For 
example:&lt;/p>
+&lt;div class=language-py>
+&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-py" 
data-lang="py">&lt;span class="k">class&lt;/span> &lt;span 
class="nc">Transaction&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">typing&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">NamedTuple&lt;/span>&lt;span class="p">):&lt;/span>
+&lt;span class="n">bank&lt;/span>&lt;span class="p">:&lt;/span> &lt;span 
class="nb">str&lt;/span>
+&lt;span class="n">purchase_amount&lt;/span>&lt;span class="p">:&lt;/span> 
&lt;span class="nb">float&lt;/span>
+&lt;span class="n">pc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="nb">input&lt;/span> &lt;span class="o">|&lt;/span> &lt;span 
class="n">beam&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">Map&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="k">lambda&lt;/span> &lt;span class="o">...&lt;/span>&lt;span 
class="p">)&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">with_output_types&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="n">Transaction&lt [...]
+&lt;/div>
+&lt;p class="language-py">&lt;strong>beam.Row&lt;/strong>&lt;/p>
+&lt;p class="language-py">It&amp;rsquo;s also possible to create ad-hoc schema 
declarations with a simple lambda
+that returns instances of &lt;code>beam.Row&lt;/code>:&lt;/p>
+&lt;div class=language-py>
+&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-py" 
data-lang="py">&lt;span class="n">input_pc&lt;/span> &lt;span 
class="o">=&lt;/span> &lt;span class="o">...&lt;/span> &lt;span class="c1"># 
{&amp;#34;bank&amp;#34;: ..., &amp;#34;purchase_amount&amp;#34;: ...}&lt;/span>
+&lt;span class="n">output_pc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="n">input_pc&lt;/span> &lt;span class="o">|&lt;/span> &lt;span 
class="n">beam&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">Map&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="k">lambda&lt;/span> &lt;span class="n">item&lt;/span>&lt;span 
class="p">:&lt;/span> &lt;span class="n">beam&lt;/span>&lt;span 
class="o">.&lt;/span>&lt;span class="n">Row&lt;/span>&lt;span 
class="p">(&lt;/span>&lt [...]
+&lt;span class="n">purchase_amount&lt;/span>&lt;span 
class="o">=&lt;/span>&lt;span class="n">item&lt;/span>&lt;span 
class="p">[&lt;/span>&lt;span 
class="s2">&amp;#34;purchase_amount&amp;#34;&lt;/span>&lt;span 
class="p">])&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
+&lt;/div>
+&lt;p class="language-py">Note that this declaration doesn&amp;rsquo;t include 
any specific information about the
+types of the &lt;code>bank&lt;/code> and &lt;code>purchase_amount&lt;/code> 
fields. Beam will attempt to infer
+type information, if it&amp;rsquo;s unable to it will fall back to the generic 
type
+&lt;code>Any&lt;/code>. Sometimes this is not ideal, you can use casts to make 
sure Beam
+correctly infers types with &lt;code>beam.Row&lt;/code>:&lt;/p>
+&lt;div class=language-py>
+&lt;div class="highlight">&lt;pre class="chroma">&lt;code class="language-py" 
data-lang="py">&lt;span class="n">input_pc&lt;/span> &lt;span 
class="o">=&lt;/span> &lt;span class="o">...&lt;/span> &lt;span class="c1"># 
{&amp;#34;bank&amp;#34;: ..., &amp;#34;purchase_amount&amp;#34;: ...}&lt;/span>
+&lt;span class="n">output_pc&lt;/span> &lt;span class="o">=&lt;/span> &lt;span 
class="n">input_pc&lt;/span> &lt;span class="o">|&lt;/span> &lt;span 
class="n">beam&lt;/span>&lt;span class="o">.&lt;/span>&lt;span 
class="n">Map&lt;/span>&lt;span class="p">(&lt;/span>&lt;span 
class="k">lambda&lt;/span> &lt;span class="n">item&lt;/span>&lt;span 
class="p">:&lt;/span> &lt;span class="n">beam&lt;/span>&lt;span 
class="o">.&lt;/span>&lt;span class="n">Row&lt;/span>&lt;span 
class="p">(&lt;/span>&lt [...]
+&lt;span class="n">purchase_amount&lt;/span>&lt;span 
class="o">=&lt;/span>&lt;span class="nb">float&lt;/span>&lt;span 
class="p">(&lt;/span>&lt;span class="n">item&lt;/span>&lt;span 
class="p">[&lt;/span>&lt;span 
class="s2">&amp;#34;purchase_amount&amp;#34;&lt;/span>&lt;span 
class="p">]))&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
+&lt;/div>
 &lt;h3 id="using-schemas">6.6. Using Schema Transforms&lt;/h3>
 &lt;p>A schema on a &lt;code>PCollection&lt;/code> enables a rich variety of 
relational transforms. The fact that each record is composed of
 named fields allows for simple and readable aggregations that reference fields 
by name, similar to the aggregations in
diff --git 
a/website/generated-content/documentation/programming-guide/index.html 
b/website/generated-content/documentation/programming-guide/index.html
index c895810..ee7b7d9 100644
--- a/website/generated-content/documentation/programming-guide/index.html
+++ b/website/generated-content/documentation/programming-guide/index.html
@@ -400,7 +400,7 @@ serialize and cache the values in your pipeline. Your 
method should meet the
 following requirements:</p><p class=language-java><ul><li>You should not in 
any way modify an element returned by
 the <code>@Element</code> annotation or 
<code>ProcessContext.sideInput()</code> (the incoming
 elements from the input collection).</li><li>Once you output a value using 
<code>OutputReceiver.output()</code> you should not modify
-that value in any way.</li></ul></p><p class=language-python><ul><li>You 
should not in any way modify the <code>element</code> argument provided to the
+that value in any way.</li></ul></p><p class=language-py><ul><li>You should 
not in any way modify the <code>element</code> argument provided to the
 <code>process</code> method, or any side inputs.</li><li>Once you output a 
value using <code>yield</code> or <code>return</code>, you should not modify
 that value in any way.</li></ul></p><h5 id=lightweight-dofns>4.2.1.3. 
Lightweight DoFns and other abstractions</h5><p>If your function is relatively 
straightforward, you can simplify your use of
 <code>ParDo</code> by providing a lightweight <code>DoFn</code> in-line, as
@@ -1360,7 +1360,7 @@ types across different programming-language APIs.</p><p>A 
<code>PCollection</cod
 Schema rows; Beam uses a special coder to encode schema types.</p><h3 
id=schemas-for-pl-types>6.2. Schemas for programming language 
types</h3><p>While schemas themselves are language independent, they are 
designed to embed naturally into the programming languages
 of the Beam SDK being used. This allows Beam users to continue using native 
types while reaping the advantage of
 having Beam understand their element schemas.</p><p class=language-java>In 
Java you could use the following set of classes to represent the purchase 
schema. Beam will automatically
-infer the correct schema based on the members of the class.</p><div 
class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=nd>@DefaultSchema</span><span 
class=o>(</span><span class=n>JavaBeanSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
+infer the correct schema based on the members of the class.</p><p 
class=language-py>In Python you can use the following set of classes to 
represent the purchase schema. Beam will automatically infer the correct schema 
based on the members of the class.</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=nd>@DefaultSchema</span><span class=o>(</span><span 
class=n>JavaBeanSchema</span><span class=o>.</span><span class=na>c [...]
 <span class=kd>public</span> <span class=kd>class</span> <span 
class=nc>Purchase</span> <span class=o>{</span>
   <span class=kd>public</span> <span class=n>String</span> <span 
class=nf>getUserId</span><span class=o>();</span>  <span class=c1>// Returns 
the id of the user who made the purchase.
 </span><span class=c1></span>  <span class=kd>public</span> <span 
class=kt>long</span> <span class=nf>getItemId</span><span class=o>();</span>  
<span class=c1>// Returns the identifier of the item that was purchased.
@@ -1399,23 +1399,41 @@ infer the correct schema based on the members of the 
class.</p><div class=langua
   <span class=kd>public</span> <span class=nf>Transaction</span><span 
class=o>(</span><span class=n>String</span> <span class=n>bank</span><span 
class=o>,</span> <span class=kt>double</span> <span 
class=n>purchaseAmount</span><span class=o>)</span> <span class=o>{</span>
      <span class=o>...</span>
   <span class=o>}</span>
-<span class=o>}</span></code></pre></div></div><p>Using JavaBean classes as 
above is one way to map a schema to Java classes. However multiple Java classes 
might have
+<span class=o>}</span></code></pre></div></div><div class=language-py><div 
class=highlight><pre class=chroma><code class=language-py data-lang=py><span 
class=kn>import</span> <span class=nn>typing</span>
+
+<span class=k>class</span> <span class=nc>Purchase</span><span 
class=p>(</span><span class=n>typing</span><span class=o>.</span><span 
class=n>NamedTuple</span><span class=p>):</span>
+  <span class=n>user_id</span><span class=p>:</span> <span class=nb>str</span> 
 <span class=c1># The id of the user who made the purchase.</span>
+  <span class=n>item_id</span><span class=p>:</span> <span class=nb>int</span> 
 <span class=c1># The identifier of the item that was purchased.</span>
+  <span class=n>shipping_address</span><span class=p>:</span> <span 
class=n>ShippingAddress</span>  <span class=c1># The shipping address, a nested 
type.</span>
+  <span class=n>cost_cents</span><span class=p>:</span> <span 
class=nb>int</span>  <span class=c1># The cost of the item</span>
+  <span class=n>transactions</span><span class=p>:</span> <span 
class=n>typing</span><span class=o>.</span><span class=n>Sequence</span><span 
class=p>[</span><span class=n>Transaction</span><span class=p>]</span>  <span 
class=c1># The transactions that paid for this purchase (a list, since the 
purchase might be spread out over multiple credit cards).</span>
+
+<span class=k>class</span> <span class=nc>ShippingAddress</span><span 
class=p>(</span><span class=n>typing</span><span class=o>.</span><span 
class=n>NamedTuple</span><span class=p>):</span>
+  <span class=n>street_address</span><span class=p>:</span> <span 
class=nb>str</span>
+  <span class=n>city</span><span class=p>:</span> <span class=nb>str</span>
+  <span class=n>state</span><span class=p>:</span> <span 
class=n>typing</span><span class=o>.</span><span class=n>Optional</span><span 
class=p>[</span><span class=nb>str</span><span class=p>]</span>
+  <span class=n>country</span><span class=p>:</span> <span class=nb>str</span>
+  <span class=n>postal_code</span><span class=p>:</span> <span 
class=nb>str</span>
+
+<span class=k>class</span> <span class=nc>Transaction</span><span 
class=p>(</span><span class=n>typing</span><span class=o>.</span><span 
class=n>NamedTuple</span><span class=p>):</span>
+  <span class=n>bank</span><span class=p>:</span> <span class=nb>str</span>
+  <span class=n>purchase_amount</span><span class=p>:</span> <span 
class=nb>float</span></code></pre></div></div><p class=language-java>Using 
JavaBean classes as above is one way to map a schema to Java classes. However 
multiple Java classes might have
 the same schema, in which case the different Java types can often be used 
interchangeably. Beam will add implicit
 conversions between types that have matching schemas. For example, the above
 <code>Transaction</code> class has the same schema as the following 
class:</p><div class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=nd>@DefaultSchema</span><span 
class=o>(</span><span class=n>JavaFieldSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
 <span class=kd>public</span> <span class=kd>class</span> <span 
class=nc>TransactionPojo</span> <span class=o>{</span>
   <span class=kd>public</span> <span class=n>String</span> <span 
class=n>bank</span><span class=o>;</span>
   <span class=kd>public</span> <span class=kt>double</span> <span 
class=n>purchaseAmount</span><span class=o>;</span>
-<span class=o>}</span></code></pre></div></div><p>So if we had two 
<code>PCollection</code>s as follows</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=n>PCollection</span><span class=o>&lt;</span><span 
class=n>Transaction</span><span class=o>&gt;</span> <span 
class=n>transactionBeans</span> <span class=o>=</span> <span 
class=n>readTransactionsAsJavaBean</span><span class=o>();</span>
-<span class=n>PCollection</span><span class=o>&lt;</span><span 
class=n>TransactionPojos</span><span class=o>&gt;</span> <span 
class=n>transactionPojos</span> <span class=o>=</span> <span 
class=n>readTransactionsAsPojo</span><span 
class=o>();</span></code></pre></div></div><p>Then these two 
<code>PCollection</code>s would have the same schema, even though their Java 
types would be different. This means
+<span class=o>}</span></code></pre></div></div><p class=language-java>So if we 
had two <code>PCollection</code>s as follows</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=n>PCollection</span><span class=o>&lt;</span><span 
class=n>Transaction</span><span class=o>&gt;</span> <span 
class=n>transactionBeans</span> <span class=o>=</span> <span 
class=n>readTransactionsAsJavaBean</span><span class=o>();</span>
+<span class=n>PCollection</span><span class=o>&lt;</span><span 
class=n>TransactionPojos</span><span class=o>&gt;</span> <span 
class=n>transactionPojos</span> <span class=o>=</span> <span 
class=n>readTransactionsAsPojo</span><span 
class=o>();</span></code></pre></div></div><p class=language-java>Then these 
two <code>PCollection</code>s would have the same schema, even though their 
Java types would be different. This means
 for example the following two code snippets are valid:</p><div 
class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=n>transactionBeans</span><span 
class=o>.</span><span class=na>apply</span><span class=o>(</span><span 
class=n>ParDo</span><span class=o>.</span><span class=na>of</span><span 
class=o>(</span><span class=k>new</span> <span class=n>DoFn</span><span 
class=o>&lt;...&gt;()</span> <span class=o>{</span>
    <span class=nd>@ProcessElement</span> <span class=kd>public</span> <span 
class=kt>void</span> <span class=nf>process</span><span class=o>(</span><span 
class=nd>@Element</span> <span class=n>TransactionPojo</span> <span 
class=n>pojo</span><span class=o>)</span> <span class=o>{</span>
       <span class=o>...</span>
    <span class=o>}</span>
-<span class=o>}));</span></code></pre></div></div><p>and<div 
class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=n>transactionPojos</span><span 
class=o>.</span><span class=na>apply</span><span class=o>(</span><span 
class=n>ParDo</span><span class=o>.</span><span class=na>of</span><span 
class=o>(</span><span class=k>new</span> <span class=n>DoFn</span><span 
class=o>&lt;...&gt;()</span> <span class=o>{</span>
+<span class=o>}));</span></code></pre></div></div><p 
class=language-java>and</p><div class=language-java><div class=highlight><pre 
class=chroma><code class=language-java data-lang=java><span 
class=n>transactionPojos</span><span class=o>.</span><span 
class=na>apply</span><span class=o>(</span><span class=n>ParDo</span><span 
class=o>.</span><span class=na>of</span><span class=o>(</span><span 
class=k>new</span> <span class=n>DoFn</span><span class=o>&lt;...&gt;()</span> 
<span class=o>{</span>
    <span class=nd>@ProcessElement</span> <span class=kd>public</span> <span 
class=kt>void</span> <span class=nf>process</span><span class=o>(</span><span 
class=nd>@Element</span> <span class=n>Transaction</span> <span 
class=n>row</span><span class=o>)</span> <span class=o>{</span>
     <span class=o>}</span>
-<span class=o>}));</span></code></pre></div></div></p><p>Even though the in 
both cases the <code>@Element</code> parameter differs from the the 
<code>PCollection</code>'s Java type, since the
+<span class=o>}));</span></code></pre></div></div><p class=language-java>Even 
though the in both cases the <code>@Element</code> parameter differs from the 
the <code>PCollection</code>'s Java type, since the
 schemas are the same Beam will automatically make the conversion. The built-in 
<code>Convert</code> transform can also be used
 to translate between Java types of equivalent schemas, as detailed 
below.</p><h3 id=schema-definition>6.3. Schema definition</h3><p>The schema for 
a <code>PCollection</code> defines elements of that <code>PCollection</code> as 
an ordered list of named fields. Each field
 has a name, a type, and possibly a set of user options. The type of a field 
can be primitive or composite. The following
@@ -1488,10 +1506,10 @@ getting just that field:</p><div 
class=language-java><div class=highlight><pre c
   <span class=k>case</span> <span class=s>&#34;bytesField&#34;</span><span 
class=o>:</span>
     <span class=k>return</span> <span class=n>processBytes</span><span 
class=o>(</span><span class=n>oneOfValue</span><span class=o>.</span><span 
class=na>getValue</span><span class=o>(</span><span class=n>bytes</span><span 
class=o>[].</span><span class=na>class</span><span class=o>));</span>
 <span class=o>}</span></code></pre></div></div><p>In the above example we used 
the field names in the switch statement for clarity, however the enum integer 
values could
-also be used.</p><h3 id=creating-schemas>6.5. Creating Schemas</h3><p>In order 
to take advantage of schemas, your <code>PCollection</code>s must have a schema 
attached to it. Often, the source itself will attach a schema to the 
PCollection. For example, when using <code>AvroIO</code> to read Avro files, 
the source can automatically infer a Beam schema from the Avro schema and 
attach that to the Beam <code>PCollection</code>. However not all sources 
produce schemas. In addition, often Bea [...]
+also be used.</p><h3 id=creating-schemas>6.5. Creating Schemas</h3><p>In order 
to take advantage of schemas, your <code>PCollection</code>s must have a schema 
attached to it. Often, the source itself will attach a schema to the 
PCollection. For example, when using <code>AvroIO</code> to read Avro files, 
the source can automatically infer a Beam schema from the Avro schema and 
attach that to the Beam <code>PCollection</code>. However not all sources 
produce schemas. In addition, often Bea [...]
 Specification. A POJO can contain member variables that are primitives, that 
are other POJOs, or are collections maps or
-arrays thereof. POJOs do not have to extend prespecified classes or extend any 
specific interfaces.</p><p>If a POJO class is annotated with 
<code>@DefaultSchema(JavaFieldSchema.class)</code>, Beam will automatically 
infer a schema for
-this class. Nested classes are supported as are classes with 
<code>List</code>, array, and <code>Map</code> fields.</p><p>For example, 
annotating the following class tells Beam to infer a schema from this POJO 
class and apply it to any
+arrays thereof. POJOs do not have to extend prespecified classes or extend any 
specific interfaces.</p><p class=language-java>If a POJO class is annotated 
with <code>@DefaultSchema(JavaFieldSchema.class)</code>, Beam will 
automatically infer a schema for
+this class. Nested classes are supported as are classes with 
<code>List</code>, array, and <code>Map</code> fields.</p><p 
class=language-java>For example, annotating the following class tells Beam to 
infer a schema from this POJO class and apply it to any
 <code>PCollection&lt;TransactionPojo></code>.</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=nd>@DefaultSchema</span><span class=o>(</span><span 
class=n>JavaFieldSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
 <span class=kd>public</span> <span class=kd>class</span> <span 
class=nc>TransactionPojo</span> <span class=o>{</span>
   <span class=kd>public</span> <span class=kd>final</span> <span 
class=n>String</span> <span class=n>bank</span><span class=o>;</span>
@@ -1503,17 +1521,17 @@ this class. Nested classes are supported as are classes 
with <code>List</code>,
   <span class=o>}</span>
 <span class=o>}</span>
 <span class=c1>// Beam will automatically infer the correct schema for this 
PCollection. No coder is needed as a result.
-</span><span class=c1></span><span class=n>PCollection</span><span 
class=o>&lt;</span><span class=n>TransactionPojo</span><span 
class=o>&gt;</span> <span class=n>pojos</span> <span class=o>=</span> <span 
class=n>readPojos</span><span class=o>();</span></code></pre></div></div><p>The 
<code>@SchemaCreate</code> annotation tells Beam that this constructor can be 
used to create instances of TransactionPojo,
+</span><span class=c1></span><span class=n>PCollection</span><span 
class=o>&lt;</span><span class=n>TransactionPojo</span><span 
class=o>&gt;</span> <span class=n>pojos</span> <span class=o>=</span> <span 
class=n>readPojos</span><span class=o>();</span></code></pre></div></div><p 
class=language-java>The <code>@SchemaCreate</code> annotation tells Beam that 
this constructor can be used to create instances of TransactionPojo,
 assuming that constructor parameters have the same names as the field names. 
<code>@SchemaCreate</code> can also be used to annotate
 static factory methods on the class, allowing the constructor to remain 
private. If there is no <code>@SchemaCreate</code>
-annotation then all the fields must be non-final and the class must have a 
zero-argument constructor.</p><p>There are a couple of other useful annotations 
that affect how Beam infers schemas. By default the schema field names
+annotation then all the fields must be non-final and the class must have a 
zero-argument constructor.</p><p class=language-java>There are a couple of 
other useful annotations that affect how Beam infers schemas. By default the 
schema field names
 inferred will match that of the class field names. However 
<code>@SchemaFieldName</code> can be used to specify a different name to
 be used for the schema field. <code>@SchemaIgnore</code> can be used to mark 
specific class fields as excluded from the inferred
 schema. For example, it’s common to have ephemeral fields in a class that 
should not be included in a schema
 (e.g. caching the hash value to prevent expensive recomputation of the hash), 
and <code>@SchemaIgnore</code> can be used to
-exclude these fields. Note that ignored fields will not be included in the 
encoding of these records.</p><p>In some cases it is not convenient to annotate 
the POJO class, for example if the POJO is in a different package that is
+exclude these fields. Note that ignored fields will not be included in the 
encoding of these records.</p><p class=language-java>In some cases it is not 
convenient to annotate the POJO class, for example if the POJO is in a 
different package that is
 not owned by the Beam pipeline author. In these cases the schema inference can 
be triggered programmatically in
-pipeline’s main function as follows:</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java data-lang=java> 
<span class=n>pipeline</span><span class=o>.</span><span 
class=na>getSchemaRegistry</span><span class=o>().</span><span 
class=na>registerPOJO</span><span class=o>(</span><span 
class=n>TransactionPOJO</span><span class=o>.</span><span 
class=na>class</span><span class=o>);</span></code></pre></div></div><h5 
id=java-beans><strong>Java Beans</stron [...]
+pipeline’s main function as follows:</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java data-lang=java> 
<span class=n>pipeline</span><span class=o>.</span><span 
class=na>getSchemaRegistry</span><span class=o>().</span><span 
class=na>registerPOJO</span><span class=o>(</span><span 
class=n>TransactionPOJO</span><span class=o>.</span><span 
class=na>class</span><span class=o>);</span></code></pre></div></div><p 
class=language-java><strong>Java Beans</ [...]
 standard has many characteristics, the key ones are that all properties are 
accessed via getter and setter classes, and
 the name format for these getters and setters is standardized. A Java Bean 
class can be annotated with
 <code>@DefaultSchema(JavaBeanSchema.class)</code> and Beam will automatically 
infer a schema for this class. For example:</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=nd>@DefaultSchema</span><span class=o>(</span><span 
class=n>JavaBeanSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
@@ -1525,22 +1543,38 @@ the name format for these getters and setters is 
standardized. A Java Bean class
   <span class=kd>public</span> <span class=kt>void</span> <span 
class=nf>setPurchaseAmount</span><span class=o>(</span><span 
class=kt>double</span> <span class=n>purchaseAmount</span><span 
class=o>)</span> <span class=o>{</span> <span class=err>…</span> <span 
class=o>}</span>
 <span class=o>}</span>
 <span class=c1>// Beam will automatically infer the correct schema for this 
PCollection. No coder is needed as a result.
-</span><span class=c1></span><span class=n>PCollection</span><span 
class=o>&lt;</span><span class=n>TransactionBean</span><span 
class=o>&gt;</span> <span class=n>beans</span> <span class=o>=</span> <span 
class=n>readBeans</span><span class=o>();</span></code></pre></div></div><p>The 
<code>@SchemaCreate</code> annotation can be used to specify a constructor or a 
static factory method, in which case the
+</span><span class=c1></span><span class=n>PCollection</span><span 
class=o>&lt;</span><span class=n>TransactionBean</span><span 
class=o>&gt;</span> <span class=n>beans</span> <span class=o>=</span> <span 
class=n>readBeans</span><span class=o>();</span></code></pre></div></div><p 
class=language-java>The <code>@SchemaCreate</code> annotation can be used to 
specify a constructor or a static factory method, in which case the
 setters and zero-argument constructor can be omitted.</p><div 
class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=nd>@DefaultSchema</span><span 
class=o>(</span><span class=n>JavaBeanSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
 <span class=kd>public</span> <span class=kd>class</span> <span 
class=nc>TransactionBean</span> <span class=o>{</span>
   <span class=nd>@SchemaCreate</span>
   <span class=n>Public</span> <span class=nf>TransactionBean</span><span 
class=o>(</span><span class=n>String</span> <span class=n>bank</span><span 
class=o>,</span> <span class=kt>double</span> <span 
class=n>purchaseAmount</span><span class=o>)</span> <span class=o>{</span> 
<span class=err>…</span> <span class=o>}</span>
   <span class=kd>public</span> <span class=n>String</span> <span 
class=nf>getBank</span><span class=o>()</span> <span class=o>{</span> <span 
class=err>…</span> <span class=o>}</span>
   <span class=kd>public</span> <span class=kt>double</span> <span 
class=nf>getPurchaseAmount</span><span class=o>()</span> <span class=o>{</span> 
<span class=err>…</span> <span class=o>}</span>
-<span 
class=o>}</span></code></pre></div></div><p><code>@SchemaFieldName</code> and 
<code>@SchemaIgnore</code> can be used to alter the schema inferred, just like 
with POJO classes.</p><h5 id=autovalue><strong>AutoValue</strong></h5><p>Java 
value classes are notoriously difficult to generate correctly. There is a lot 
of boilerplate you must create in
+<span class=o>}</span></code></pre></div></div><p 
class=language-java><code>@SchemaFieldName</code> and 
<code>@SchemaIgnore</code> can be used to alter the schema inferred, just like 
with POJO classes.</p><p class=language-java><strong>AutoValue</strong></p><p 
class=language-java>Java value classes are notoriously difficult to generate 
correctly. There is a lot of boilerplate you must create in
 order to properly implement a value class. AutoValue is a popular library for 
easily generating such classes by
-implementing a simple abstract base class.</p><p>Beam can infer a schema from 
an AutoValue class. For example:</p><div class=language-java><div 
class=highlight><pre class=chroma><code class=language-java 
data-lang=java><span class=nd>@DefaultSchema</span><span class=o>(</span><span 
class=n>AutoValueSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
+implementing a simple abstract base class.</p><p class=language-java>Beam can 
infer a schema from an AutoValue class. For example:</p><div 
class=language-java><div class=highlight><pre class=chroma><code 
class=language-java data-lang=java><span class=nd>@DefaultSchema</span><span 
class=o>(</span><span class=n>AutoValueSchema</span><span class=o>.</span><span 
class=na>class</span><span class=o>)</span>
 <span class=nd>@AutoValue</span>
 <span class=kd>public</span> <span class=kd>abstract</span> <span 
class=kd>class</span> <span class=nc>TransactionValue</span> <span 
class=o>{</span>
   <span class=kd>public</span> <span class=kd>abstract</span> <span 
class=n>String</span> <span class=nf>getBank</span><span class=o>();</span>
   <span class=kd>public</span> <span class=kd>abstract</span> <span 
class=kt>double</span> <span class=nf>getPurchaseAmount</span><span 
class=o>();</span>
-<span class=o>}</span></code></pre></div></div><p>This is all that’s needed to 
generate a simple AutoValue class, and the above <code>@DefaultSchema</code> 
annotation tells Beam to
-infer a schema from it. This also allows AutoValue elements to be used inside 
of <code>PCollection</code>s.</p><p><code>@SchemaFieldName</code> and 
<code>@SchemaIgnore</code> can be used to alter the schema inferred.</p><h3 
id=using-schemas>6.6. Using Schema Transforms</h3><p>A schema on a 
<code>PCollection</code> enables a rich variety of relational transforms. The 
fact that each record is composed of
+<span class=o>}</span></code></pre></div></div><p class=language-java>This is 
all that’s needed to generate a simple AutoValue class, and the above 
<code>@DefaultSchema</code> annotation tells Beam to
+infer a schema from it. This also allows AutoValue elements to be used inside 
of <code>PCollection</code>s.</p><p 
class=language-java><code>@SchemaFieldName</code> and 
<code>@SchemaIgnore</code> can be used to alter the schema inferred.</p><p 
class=language-py>Beam has a few different mechanisms for inferring schemas 
from Python code.</p><p class=language-py><strong>NamedTuple 
classes</strong></p><p class=language-py>A <a 
href=https://docs.python.org/3/library/typing.html#typing.NamedTup [...]
+class is a Python class that wraps a <code>tuple</code>, assigning a name to 
each element
+and restricting it to a particular type. Beam will automatically infer the
+schema for PCollections with <code>NamedTuple</code> output types. For 
example:</p><div class=language-py><div class=highlight><pre class=chroma><code 
class=language-py data-lang=py><span class=k>class</span> <span 
class=nc>Transaction</span><span class=p>(</span><span 
class=n>typing</span><span class=o>.</span><span class=n>NamedTuple</span><span 
class=p>):</span>
+  <span class=n>bank</span><span class=p>:</span> <span class=nb>str</span>
+  <span class=n>purchase_amount</span><span class=p>:</span> <span 
class=nb>float</span>
+
+<span class=n>pc</span> <span class=o>=</span> <span class=nb>input</span> 
<span class=o>|</span> <span class=n>beam</span><span class=o>.</span><span 
class=n>Map</span><span class=p>(</span><span class=k>lambda</span> <span 
class=o>...</span><span class=p>)</span><span class=o>.</span><span 
class=n>with_output_types</span><span class=p>(</span><span 
class=n>Transaction</span><span class=p>)</span></code></pre></div></div><p 
class=language-py><strong>beam.Row</strong></p><p class=languag [...]
+that returns instances of <code>beam.Row</code>:</p><div 
class=language-py><div class=highlight><pre class=chroma><code 
class=language-py data-lang=py><span class=n>input_pc</span> <span 
class=o>=</span> <span class=o>...</span> <span class=c1># {&#34;bank&#34;: 
..., &#34;purchase_amount&#34;: ...}</span>
+<span class=n>output_pc</span> <span class=o>=</span> <span 
class=n>input_pc</span> <span class=o>|</span> <span class=n>beam</span><span 
class=o>.</span><span class=n>Map</span><span class=p>(</span><span 
class=k>lambda</span> <span class=n>item</span><span class=p>:</span> <span 
class=n>beam</span><span class=o>.</span><span class=n>Row</span><span 
class=p>(</span><span class=n>bank</span><span class=o>=</span><span 
class=n>item</span><span class=p>[</span><span class=s2>&#34;bank&#34; [...]
+                                                      <span 
class=n>purchase_amount</span><span class=o>=</span><span 
class=n>item</span><span class=p>[</span><span 
class=s2>&#34;purchase_amount&#34;</span><span 
class=p>])</span></code></pre></div></div><p class=language-py>Note that this 
declaration doesn&rsquo;t include any specific information about the
+types of the <code>bank</code> and <code>purchase_amount</code> fields. Beam 
will attempt to infer
+type information, if it&rsquo;s unable to it will fall back to the generic type
+<code>Any</code>. Sometimes this is not ideal, you can use casts to make sure 
Beam
+correctly infers types with <code>beam.Row</code>:</p><div 
class=language-py><div class=highlight><pre class=chroma><code 
class=language-py data-lang=py><span class=n>input_pc</span> <span 
class=o>=</span> <span class=o>...</span> <span class=c1># {&#34;bank&#34;: 
..., &#34;purchase_amount&#34;: ...}</span>
+<span class=n>output_pc</span> <span class=o>=</span> <span 
class=n>input_pc</span> <span class=o>|</span> <span class=n>beam</span><span 
class=o>.</span><span class=n>Map</span><span class=p>(</span><span 
class=k>lambda</span> <span class=n>item</span><span class=p>:</span> <span 
class=n>beam</span><span class=o>.</span><span class=n>Row</span><span 
class=p>(</span><span class=n>bank</span><span class=o>=</span><span 
class=nb>str</span><span class=p>(</span><span class=n>item</span><spa [...]
+                                                      <span 
class=n>purchase_amount</span><span class=o>=</span><span 
class=nb>float</span><span class=p>(</span><span class=n>item</span><span 
class=p>[</span><span class=s2>&#34;purchase_amount&#34;</span><span 
class=p>]))</span></code></pre></div></div><h3 id=using-schemas>6.6. Using 
Schema Transforms</h3><p>A schema on a <code>PCollection</code> enables a rich 
variety of relational transforms. The fact that each record is composed of
 named fields allows for simple and readable aggregations that reference fields 
by name, similar to the aggregations in
 a SQL expression.</p><h4 id=661-field-selection-syntax>6.6.1. Field selection 
syntax</h4><p>The advantage of schemas is that they allow referencing of 
element fields by name. Beam provides a selection syntax for
 referencing fields, including nested and repeated fields. This syntax is used 
by all of the schema transforms when
diff --git a/website/generated-content/sitemap.xml 
b/website/generated-content/sitemap.xml
index 16088ee..37bba15 100644
--- a/website/generated-content/sitemap.xml
+++ b/website/generated-content/sitemap.xml
@@ -1 +1 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset 
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml";><url><loc>/blog/beam-2.24.0/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/categories/blog/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/blog/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/categories/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/blog/p
 [...]
\ No newline at end of file
+<?xml version="1.0" encoding="utf-8" standalone="yes"?><urlset 
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml";><url><loc>/blog/beam-2.24.0/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/categories/blog/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/blog/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/categories/</loc><lastmod>2020-09-18T12:38:38-07:00</lastmod></url><url><loc>/blog/p
 [...]
\ No newline at end of file

Reply via email to