You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "kerrydc (via GitHub)" <gi...@apache.org> on 2023/02/13 21:24:06 UTC

[GitHub] [beam] kerrydc commented on a diff in pull request #23577: [Tour of Beam] Learning content for "Common-transforms" module

kerrydc commented on code in PR #23577:
URL: https://github.com/apache/beam/pull/23577#discussion_r1104833593


##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.

Review Comment:
   The triple quotes create strange line breaks, is there a way to fix the rendering? Or you could use single quotes, that seems to render better. 



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.

Review Comment:
   ou can count the number of elements in a ```PCollection``` with ```CountElms()```, it will return one element.



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :

Review Comment:
   `Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` with `beam.combiners.Count.PerKey` it will output the count numbers by key :



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?

Review Comment:
   Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])

Review Comment:
   (p | beam.Create(["To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troubles, And by opposing end them. To die: to sleep"])



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])
+  | beam.ParDo(SplitWords())
+  | beam.combiners.Count.PerElement()
+  | Output(prefix='PCollection filtered value: '))
+```
+
+For split word you can use:

Review Comment:
   For Splitwords you can use this class:



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])
+  | beam.ParDo(SplitWords())
+  | beam.combiners.Count.PerElement()
+  | Output(prefix='PCollection filtered value: '))
+```
+
+For split word you can use:
+
+```
+class SplitWords(beam.DoFn):
+  def __init__(self, delimiter=' '):
+    self.delimiter = delimiter
+
+  def process(self, text):
+    for word in text.split(self.delimiter):
+      yield word
+```
+{{end}}
+{{if (eq .Sdk "go")}}
+`CountElms` returns the number of integers from the `PCollection`. If you replace `CountElms` with `Count` you can count the elements by the values of how many times they met.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Count` returns the count elements from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Count.globally` on `Count.perKey` it will output the count numbers by key. It is also necessary to replace the generic type:

Review Comment:
   And replace `Count.globally` with `Count.perKey` it will output the count numbers by key. It is also necessary to replace the generic type:



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])
+  | beam.ParDo(SplitWords())
+  | beam.combiners.Count.PerElement()
+  | Output(prefix='PCollection filtered value: '))
+```
+
+For split word you can use:
+
+```
+class SplitWords(beam.DoFn):
+  def __init__(self, delimiter=' '):
+    self.delimiter = delimiter
+
+  def process(self, text):
+    for word in text.split(self.delimiter):
+      yield word
+```
+{{end}}
+{{if (eq .Sdk "go")}}
+`CountElms` returns the number of integers from the `PCollection`. If you replace `CountElms` with `Count` you can count the elements by the values of how many times they met.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Count` returns the count elements from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Count.globally` on `Count.perKey` it will output the count numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(numbers);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Count.globally());
+}
+```
+{{end}}
+
+{{if (eq .Sdk "go java")}}
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Don't forget to add import:
+{{end}}
+{{if (eq .Sdk "go")}}
+```
+import (
+    "strings"
+    ...
+)
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+import java.util.Arrays;
+import org.apache.beam.sdk.values.KV;
+```
+{{end}}
+
+{{if (eq .Sdk "go java")}}
+Create data for PCollection:
+
+```
+String str = "To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep";

Review Comment:
   as above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])
+  | beam.ParDo(SplitWords())
+  | beam.combiners.Count.PerElement()
+  | Output(prefix='PCollection filtered value: '))
+```
+
+For split word you can use:
+
+```
+class SplitWords(beam.DoFn):
+  def __init__(self, delimiter=' '):
+    self.delimiter = delimiter
+
+  def process(self, text):
+    for word in text.split(self.delimiter):
+      yield word
+```
+{{end}}
+{{if (eq .Sdk "go")}}
+`CountElms` returns the number of integers from the `PCollection`. If you replace `CountElms` with `Count` you can count the elements by the values of how many times they met.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Count` returns the count elements from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Count.globally` on `Count.perKey` it will output the count numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(numbers);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Count.globally());
+}
+```
+{{end}}
+
+{{if (eq .Sdk "go java")}}
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?

Review Comment:
   Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline

Review Comment:
   as above
   



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   as above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());

Review Comment:
   PCollection<Long> output = input.apply(Count.globally());



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

Review Comment:
   PCollection<Integer> input = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(

Review Comment:
   p | 'Create plants' >> beam.Create(



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

Review Comment:
   PCollection<Integer> input = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+

Review Comment:
   Need to create a PCollection of KV pairs



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([
+    (1, 36),
+    (2, 91),
+    (3, 33),
+    (3, 11),
+    (4, 67),
+]) | beam.combiners.Count.PerKey()
+```
+
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Count how many words are repeated with `Count`:
+
+```
+  (p | beam.Create(["To be, or not to be: that is the question:Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune,Or to take arms against a sea of troubles,And by opposing end them. To die: to sleep"])
+  | beam.ParDo(SplitWords())
+  | beam.combiners.Count.PerElement()
+  | Output(prefix='PCollection filtered value: '))
+```
+
+For split word you can use:
+
+```
+class SplitWords(beam.DoFn):
+  def __init__(self, delimiter=' '):
+    self.delimiter = delimiter
+
+  def process(self, text):
+    for word in text.split(self.delimiter):
+      yield word
+```
+{{end}}
+{{if (eq .Sdk "go")}}
+`CountElms` returns the number of integers from the `PCollection`. If you replace `CountElms` with `Count` you can count the elements by the values of how many times they met.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Count` returns the count elements from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Count.globally` on `Count.perKey` it will output the count numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(numbers);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Count.globally());
+}
+```
+{{end}}
+
+{{if (eq .Sdk "go java")}}
+And Count transforms work with strings too! Can you change the example to count the number of words in a given sentence and how often each word occurs?
+
+Don't forget to add import:
+{{end}}
+{{if (eq .Sdk "go")}}
+```
+import (
+    "strings"
+    ...
+)
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+import java.util.Arrays;
+import org.apache.beam.sdk.values.KV;
+```
+{{end}}
+
+{{if (eq .Sdk "go java")}}

Review Comment:
   I don't see think this is rendering correctly. Please double check that this content appears in go and java, I only see it in python. I suspect the eq .Sdk is not matching 



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> max = input.apply(Max.doublesGlobally());
+```
+
+Output
+
+```
+10
+```
+
+You can use ```Max.integersPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> maxPerKey = input.apply(Max.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ…, 5}
+KV{πŸ₯•, 3}
+KV{πŸ†, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+
+### Maximum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: max(elements or [None]))``` to get the maximum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  max_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get max value' >>
+      beam.CombineGlobally(lambda elements: max(elements or [None]))
+      | beam.Map(print))
+```
+
+Output
+
+```
+4
+```
+
+### Maximum elements for each key
+
+You can use ```Combine.PerKey()``` to get the maximum element for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   see above, use 'p'



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.

Review Comment:
   You can use ```Count()``` to count how many elements are associated with a particular key. The result will be one output for each key.



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> max = input.apply(Max.doublesGlobally());
+```
+
+Output
+
+```
+10
+```
+
+You can use ```Max.integersPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> maxPerKey = input.apply(Max.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ…, 5}
+KV{πŸ₯•, 3}
+KV{πŸ†, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+
+### Maximum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: max(elements or [None]))``` to get the maximum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  max_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get max value' >>
+      beam.CombineGlobally(lambda elements: max(elements or [None]))
+      | beam.Map(print))
+```
+
+Output
+
+```
+4
+```
+
+### Maximum elements for each key
+
+You can use ```Combine.PerKey()``` to get the maximum element for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  elements_with_max_value_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Get max value per key' >> beam.CombinePerKey(max)
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ₯•', 3)
+('πŸ†', 1)
+('πŸ…', 5)
+```
+{{end}}
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Max` returns the maximum number from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Max` on `stats.MaxPerKey` it will output the maximum numbers by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Max.doublesGlobally` returns the maximum element from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Max.doublesGlobally` on `Max.integersPerKey` it will output the maximum numbers by key. It is also necessary to replace the generic type:

Review Comment:
   And replace `Max.doublesGlobally` with `Max.integersPerKey` it will output the maximum numbers by key. It is also necessary to replace the generic type:



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

Review Comment:
   PCollection<Integer> input = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> mean = numbers.apply(Mean.globally());
+```
+
+Output
+
+```
+5.5
+```
+
+
+```Mean.perKey()``` returns a transform that returns a collection containing an output element mapping each distinct key in the input collection to the mean of the values associated with that key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Double>> meanPerKey = input.apply(Mean.perKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1.0}
+KV{πŸ₯•, 2.5}
+KV{πŸ…, 4.0}
+```
+{{end}}
+{{if (eq .Sdk "python")}}

Review Comment:
   why no python content?



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> max = input.apply(Max.doublesGlobally());
+```
+
+Output
+
+```
+10
+```
+
+You can use ```Max.integersPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> maxPerKey = input.apply(Max.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ…, 5}
+KV{πŸ₯•, 3}
+KV{πŸ†, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+
+### Maximum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: max(elements or [None]))``` to get the maximum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  max_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get max value' >>
+      beam.CombineGlobally(lambda elements: max(elements or [None]))
+      | beam.Map(print))
+```
+
+Output
+
+```
+4
+```
+
+### Maximum elements for each key
+
+You can use ```Combine.PerKey()``` to get the maximum element for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  elements_with_max_value_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Get max value per key' >> beam.CombinePerKey(max)
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ₯•', 3)
+('πŸ†', 1)
+('πŸ…', 5)
+```
+{{end}}
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Max` returns the maximum number from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Max` on `stats.MaxPerKey` it will output the maximum numbers by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Max.doublesGlobally` returns the maximum element from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Max.doublesGlobally` on `Max.integersPerKey` it will output the maximum numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(numbers);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Max.integersPerKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`Top.Largest` returns larger numbers from `PCCollection` than specified in the function argument. If you replace the `integers input` with this `map input` and replace `beam.combiners.Top.Largest(5)` on `beam.CombinePerKey(max)` it will output the maximum numbers by key :

Review Comment:
   `Top.Largest(n)` returns the n largest numbers from the `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Top.Largest(5)` with `beam.CombinePerKey(max)` it will output the maximum numbers by key :



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline

Review Comment:
   p | 'Create plants' >> beam.Create([



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> mean = numbers.apply(Mean.globally());

Review Comment:
   PCollection<Double> mean = input.apply(Mean.globally());



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> mean = numbers.apply(Mean.globally());
+```
+
+Output
+
+```
+5.5
+```
+
+
+```Mean.perKey()``` returns a transform that returns a collection containing an output element mapping each distinct key in the input collection to the mean of the values associated with that key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Double>> meanPerKey = input.apply(Mean.perKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1.0}
+KV{πŸ₯•, 2.5}
+KV{πŸ…, 4.0}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+{{end}}
+
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Mean` returns the mean from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Mean` on `stats.MeanPerKey` it will output the mean by key.

Review Comment:
   And replace `stats.Mean` with `stats.MeanPerKey` it will output the mean by key.



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   with beam.Pipeline() as p:



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> min = input.apply(Min.doublesGlobally());
+```
+
+Output
+
+```
+1
+```
+
+You can use ```Min.integersPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> minPerKey = input.apply(Min.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Minimum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: min(elements or [-1]))``` to get the minimum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   pipeline should be p



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> mean = numbers.apply(Mean.globally());
+```
+
+Output
+
+```
+5.5
+```
+
+
+```Mean.perKey()``` returns a transform that returns a collection containing an output element mapping each distinct key in the input collection to the mean of the values associated with that key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Double>> meanPerKey = input.apply(Mean.perKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1.0}
+KV{πŸ₯•, 2.5}
+KV{πŸ…, 4.0}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+{{end}}
+
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Mean` returns the mean from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Mean` on `stats.MeanPerKey` it will output the mean by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Mean.globally` returns the mean from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Mean.globally` on `Mean.perKey` it will output the means by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Double>> output = applyTransform(input);
+```
+
+```
+static PCollection<KV<Integer, Double>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Mean.perKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`beam.combiners.Mean.Globally()` returns mean from `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Mean.Globally()` on `beam.combiners.Mean.PerKey()` it will output the mean by key :

Review Comment:
   `beam.combiners.Mean.Globally()` returns the mean of the `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Mean.Globally()` with `beam.combiners.Mean.PerKey()` it will output the mean by key :



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/count/description.md:
##########
@@ -0,0 +1,311 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Count
+
+`Count` provides many transformations for calculating the count of values in a `PCollection`, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+Counts the number of elements within each aggregation. The Count transform has two varieties:
+
+You can count the number of elements in ```PCollection``` with ```CountElms()```, it will return one element.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.CountElms(s, input)
+}
+```
+
+You can use ```Count()``` to count how many elements are associated with a particular key, the result will be one output for each key.
+
+```
+import (
+    "github.com/apache/beam/sdks/go/pkg/beam"
+    "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+    return stats.Count(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+Counts the number of elements within each aggregation. The Count transform has three varieties:
+
+### Counting all elements in a PCollection
+
+```Count.globally()``` counts the number of elements in the entire PCollection. The result is a collection with a single element.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Long> output = numbers.apply(Count.globally());
+```
+
+Output
+```
+10
+```
+
+### Counting elements for each key
+
+```Count.perKey()``` counts how many elements are associated with each key. It ignores the values. The resulting collection has one output for every key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perKey());
+```
+
+Output
+
+```
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+KV{πŸ†, 1}
+```
+
+### Counting all unique elements
+
+```Count.perElement()``` counts how many times each element appears in the input collection. The output collection is a key-value pair, containing each unique element and the number of times it appeared in the original collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 3),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Long>> output = input.apply(Count.perElement());
+```
+
+Output
+
+```
+KV{KV{πŸ…, 3}, 2}
+KV{KV{πŸ₯•, 2}, 1}
+KV{KV{πŸ†, 1}, 1}
+KV{KV{πŸ₯•, 3}, 1}
+KV{KV{πŸ…, 5}, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Counting all elements in a PCollection
+
+You can use ```Count.Globally()``` to count all elements in a PCollection, even if there are duplicate elements.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements = (
+      pipeline
+      | 'Create plants' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count all elements' >> beam.combiners.Count.Globally()
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Counting elements for each key
+
+You can use ```Count.PerKey()``` to count the elements for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_elements_per_keys = (
+      pipeline
+      | 'Create plants' >> beam.Create([
+          ('spring', 'πŸ“'),
+          ('spring', 'πŸ₯•'),
+          ('summer', 'πŸ₯•'),
+          ('fall', 'πŸ₯•'),
+          ('spring', 'πŸ†'),
+          ('winter', 'πŸ†'),
+          ('spring', 'πŸ…'),
+          ('summer', 'πŸ…'),
+          ('fall', 'πŸ…'),
+          ('summer', '🌽'),
+      ])
+      | 'Count elements per key' >> beam.combiners.Count.PerKey()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('spring', 4)
+('summer', 3)
+('fall', 2)
+('winter', 1)
+```
+
+### Counting all unique elements
+
+You can use ```Count.PerElement()``` to count only the unique elements in a PCollection.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total_unique_elements = (
+      pipeline
+      | 'Create produce' >> beam.Create(
+          ['πŸ“', 'πŸ₯•', 'πŸ₯•', 'πŸ₯•', 'πŸ†', 'πŸ†', 'πŸ…', 'πŸ…', 'πŸ…', '🌽'])
+      | 'Count unique elements' >> beam.combiners.Count.PerElement()
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ“', 1)
+('πŸ₯•', 3)
+('πŸ†', 2)
+('πŸ…', 3)
+('🌽', 1)
+```
+{{end}}
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "python")}}
+`Count.globally` returns the number of integers from the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Count.Globally` on `beam.combiners.Count.PerKey` it will output the count numbers by key :
+
+```
+beam.Create([

Review Comment:
   (p |  beam.Create([



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> min = input.apply(Min.doublesGlobally());
+```
+
+Output
+
+```
+1
+```
+
+You can use ```Min.integersPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> minPerKey = input.apply(Min.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Minimum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: min(elements or [-1]))``` to get the minimum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  min_element = (
+      pipeline

Review Comment:
   see above
   



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> min = input.apply(Min.doublesGlobally());
+```
+
+Output
+
+```
+1
+```
+
+You can use ```Min.integersPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> minPerKey = input.apply(Min.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Minimum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: min(elements or [-1]))``` to get the minimum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  min_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get min value' >>
+      beam.CombineGlobally(lambda elements: min(elements or [-1]))
+      | beam.Map(print))
+```
+
+Output
+```
+1
+```
+
+### Minimum elements for each key
+
+You can use ```Combine.PerKey()``` to get the minimum element for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+

Review Comment:
   create data with KV pairs



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> min = input.apply(Min.doublesGlobally());
+```
+
+Output
+
+```
+1
+```
+
+You can use ```Min.integersPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> minPerKey = input.apply(Min.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Minimum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: min(elements or [-1]))``` to get the minimum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  min_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get min value' >>
+      beam.CombineGlobally(lambda elements: min(elements or [-1]))
+      | beam.Map(print))
+```
+
+Output
+```
+1
+```
+
+### Minimum elements for each key
+
+You can use ```Combine.PerKey()``` to get the minimum element for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  elements_with_min_value_per_key = (
+      pipeline

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> min = input.apply(Min.doublesGlobally());
+```
+
+Output
+
+```
+1
+```
+
+You can use ```Min.integersPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> minPerKey = input.apply(Min.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ₯•, 2}
+KV{πŸ…, 3}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Minimum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: min(elements or [-1]))``` to get the minimum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  min_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get min value' >>
+      beam.CombineGlobally(lambda elements: min(elements or [-1]))
+      | beam.Map(print))
+```
+
+Output
+```
+1
+```
+
+### Minimum elements for each key
+
+You can use ```Combine.PerKey()``` to get the minimum element for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  elements_with_min_value_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Get min value per key' >> beam.CombinePerKey(min)
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ₯•', 2)
+('πŸ†', 1)
+('πŸ…', 3)
+```
+{{end}}
+
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Min` returns the minimum number from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Min` on `stats.MinPerKey` it will output the minimum numbers by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Min.integersGlobally` returns the minimum number from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Min.integersGlobally` on `Min.integersPerKey` it will output the minimum numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(input);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Sum.integersPerKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`Top.Smallest` returns smaller numbers from `PCollection` than specified in the function argument. If you replace the `integers input` with this `map input` and replace `beam.combiners.Top.Smallest(5)` on `beam.CombinePerKey(min)` it will output the minimum numbers by key :

Review Comment:
   `Top.Smallest(n)` returns the n smallest numbers from  the `PCollection`. If you replace the `integers input` with this `map input` and replace `beam.combiners.Top.Smallest(5)` with `beam.CombinePerKey(min)` it will output the minimum numbers by key :



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/mean/description.md:
##########
@@ -0,0 +1,141 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Mean
+
+You can use Mean transforms to compute the arithmetic mean of the elements in a collection or the mean of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```Mean()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Mean(s, input)
+}
+```
+
+You can use ```MeanPerKey()``` to calculate the mean of the elements associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MeanPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```Mean.globally()``` returns a transformation that returns a collection whose content is the average of the elements of the input collection. If there are no elements in the input collection, 0 is returned.
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> mean = numbers.apply(Mean.globally());
+```
+
+Output
+
+```
+5.5
+```
+
+
+```Mean.perKey()``` returns a transform that returns a collection containing an output element mapping each distinct key in the input collection to the mean of the values associated with that key in the input collection.
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Double>> meanPerKey = input.apply(Mean.perKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1.0}
+KV{πŸ₯•, 2.5}
+KV{πŸ…, 4.0}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+{{end}}
+
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Mean` returns the mean from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Mean` on `stats.MeanPerKey` it will output the mean by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Mean.globally` returns the mean from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Mean.globally` on `Mean.perKey` it will output the means by key. It is also necessary to replace the generic type:

Review Comment:
   nd replace `Mean.globally` with `Mean.perKey` it will output the means by key. It is also necessary to replace the generic type:



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> max = input.apply(Max.doublesGlobally());
+```
+
+Output
+
+```
+10
+```
+
+You can use ```Max.integersPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> maxPerKey = input.apply(Max.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ…, 5}
+KV{πŸ₯•, 3}
+KV{πŸ†, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+
+### Maximum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: max(elements or [None]))``` to get the maximum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  max_element = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Get max value' >>
+      beam.CombineGlobally(lambda elements: max(elements or [None]))
+      | beam.Map(print))
+```
+
+Output
+
+```
+4
+```
+
+### Maximum elements for each key
+
+You can use ```Combine.PerKey()``` to get the maximum element for each unique key in a PCollection of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  elements_with_max_value_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Get max value per key' >> beam.CombinePerKey(max)
+      | beam.Map(print))
+```
+
+Output
+
+```
+('πŸ₯•', 3)
+('πŸ†', 1)
+('πŸ…', 5)
+```
+{{end}}
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+{{if (eq .Sdk "go")}}
+`Max` returns the maximum number from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Max` on `stats.MaxPerKey` it will output the maximum numbers by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Max.doublesGlobally` returns the maximum element from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Max.doublesGlobally` on `Max.integersPerKey` it will output the maximum numbers by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(numbers);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Max.integersPerKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`Top.Largest` returns larger numbers from `PCCollection` than specified in the function argument. If you replace the `integers input` with this `map input` and replace `beam.combiners.Top.Largest(5)` on `beam.CombinePerKey(max)` it will output the maximum numbers by key :
+
+```
+beam.Create([

Review Comment:
   ( p | beam.Create([



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

Review Comment:
   numbers -> input



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());
+```
+
+Output
+
+```
+55
+```
+
+You can use ```Sum.integersPerKey()```to calculate the sum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> sumPerKey = input.apply(Sum.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ…, 12}
+KV{πŸ₯•, 5}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Sum of the elements in a PCollection
+
+You can find the global sum value from the ```PCollection``` by using ```CombineGlobally(sum)```
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total = (

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/max/description.md:
##########
@@ -0,0 +1,192 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Max
+
+Max provides a variety of different transforms for computing the maximum values in a collection, either globally or for each key.
+
+{{if (eq .Sdk "go")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Max(s, input)
+}
+```
+
+You can use ```MaxPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MaxPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global maximum value from the ```PCollection``` by using ```Max.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> max = input.apply(Max.doublesGlobally());
+```
+
+Output
+
+```
+10
+```
+
+You can use ```Max.integersPerKey()``` to calculate the maximum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> maxPerKey = input.apply(Max.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ…, 5}
+KV{πŸ₯•, 3}
+KV{πŸ†, 1}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+
+### Maximum element in a PCollection
+
+You can use ```CombineGlobally(lambda elements: max(elements or [None]))``` to get the maximum element from the entire ```PCollection```.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   see above, use 'p'



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());
+```
+
+Output
+
+```
+55
+```
+
+You can use ```Sum.integersPerKey()```to calculate the sum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> sumPerKey = input.apply(Sum.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ…, 12}
+KV{πŸ₯•, 5}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Sum of the elements in a PCollection
+
+You can find the global sum value from the ```PCollection``` by using ```CombineGlobally(sum)```
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());
+```
+
+Output
+
+```
+55
+```
+
+You can use ```Sum.integersPerKey()```to calculate the sum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> sumPerKey = input.apply(Sum.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ…, 12}
+KV{πŸ₯•, 5}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Sum of the elements in a PCollection
+
+You can find the global sum value from the ```PCollection``` by using ```CombineGlobally(sum)```
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Sum values' >> beam.CombineGlobally(sum)
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Sum of the elements for each key
+
+You can use ```Combine.PerKey()``` to get the sum of all the element values for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  totals_per_key = (
+      pipeline

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.

Review Comment:
   PCollections can be filtered using the Filter transform. You can create a filter by supplying a predicate. This will filter out all the elements of the PCollection that don’t satisfy the predicate.



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());
+```
+
+Output
+
+```
+55
+```
+
+You can use ```Sum.integersPerKey()```to calculate the sum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> sumPerKey = input.apply(Sum.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ…, 12}
+KV{πŸ₯•, 5}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Sum of the elements in a PCollection
+
+You can find the global sum value from the ```PCollection``` by using ```CombineGlobally(sum)```
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Sum values' >> beam.CombineGlobally(sum)
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Sum of the elements for each key
+
+You can use ```Combine.PerKey()``` to get the sum of all the element values for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  totals_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Sum values per key' >> beam.CombinePerKey(sum)
+      | beam.Map(print))
+```
+
+Output
+```
+('πŸ₯•', 5)
+('πŸ†', 1)
+('πŸ…', 12)
+```
+{{end}}
+You can use ```Sum()``` to sum the elements of a ```PCollection```.
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+
+{{if (eq .Sdk "go")}}
+`Sum` returns the sum from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Sum` on `stats.SumPerKey` it will output the sum by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Sum.integersGlobally` returns the sum from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Sum.integersGlobally` on `Sum.integersPerKey` it will output the sum by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(input);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Sum.integersPerKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`beam.CombineGlobally(sum)` returns sum from `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.CombineGlobally(sum)` on `beam.CombinePerKey(sum)` it will output the sum by key :
+
+```
+beam.Create([

Review Comment:
   see above



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/min/description.md:
##########
@@ -0,0 +1,190 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Min
+
+Min transforms find the minimum values globally or for each key in the input collection.
+{{if (eq .Sdk "go")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min()```
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Min(s, input)
+}
+```
+
+You can use ```MinPerKey()``` to calculate the minimum Integer associated with each unique key (which is of type String).
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.MinPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global minimum value from the ```PCollection``` by using ```Min.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));

Review Comment:
   PCollection<Integer> input = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));



##########
learning/tour-of-beam/learning-content/common-transforms/aggregation/sum/description.md:
##########
@@ -0,0 +1,188 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Sum
+
+You can use Sum transforms to compute the sum of the elements in a collection or the sum of the values associated with each key in a collection of key-value pairs.
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.Sum(s, input)
+}
+```
+
+You can use ```SumPerKey()```to calculate the sum Integer associated with each unique key.
+
+```
+import (
+  "github.com/apache/beam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/stats"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return stats.SumPerKey(s, input)
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+You can find the global sum value from the ```PCollection``` by using ```Sum.doublesGlobally()```
+
+```
+PCollection<Integer> numbers = pipeline.apply(Create.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
+PCollection<Double> sum = numbers.apply(Sum.doublesGlobally());
+```
+
+Output
+
+```
+55
+```
+
+You can use ```Sum.integersPerKey()```to calculate the sum Integer associated with each unique key (which is of type String).
+
+```
+PCollection<KV<String, Integer>> input = pipeline.apply(
+    Create.of(KV.of("πŸ₯•", 3),
+              KV.of("πŸ₯•", 2),
+              KV.of("πŸ†", 1),
+              KV.of("πŸ…", 4),
+              KV.of("πŸ…", 5),
+              KV.of("πŸ…", 3)));
+PCollection<KV<String, Integer>> sumPerKey = input.apply(Sum.integersPerKey());
+```
+
+Output
+
+```
+KV{πŸ†, 1}
+KV{πŸ…, 12}
+KV{πŸ₯•, 5}
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+### Sum of the elements in a PCollection
+
+You can find the global sum value from the ```PCollection``` by using ```CombineGlobally(sum)```
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  total = (
+      pipeline
+      | 'Create numbers' >> beam.Create([3, 4, 1, 2])
+      | 'Sum values' >> beam.CombineGlobally(sum)
+      | beam.Map(print))
+```
+
+Output
+
+```
+10
+```
+
+### Sum of the elements for each key
+
+You can use ```Combine.PerKey()``` to get the sum of all the element values for each unique key in a ```PCollection``` of key-values.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  totals_per_key = (
+      pipeline
+      | 'Create produce' >> beam.Create([
+          ('πŸ₯•', 3),
+          ('πŸ₯•', 2),
+          ('πŸ†', 1),
+          ('πŸ…', 4),
+          ('πŸ…', 5),
+          ('πŸ…', 3),
+      ])
+      | 'Sum values per key' >> beam.CombinePerKey(sum)
+      | beam.Map(print))
+```
+
+Output
+```
+('πŸ₯•', 5)
+('πŸ†', 1)
+('πŸ…', 12)
+```
+{{end}}
+You can use ```Sum()``` to sum the elements of a ```PCollection```.
+
+### Playground exercise
+
+You can find the full code of this example in the playground window, which you can run and experiment with.
+
+{{if (eq .Sdk "go")}}
+`Sum` returns the sum from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+input:= beam.ParDo(s, func(_ []byte, emit func(int, int)){
+  emit(1,1)
+  emit(1,4)
+  emit(2,6)
+  emit(2,3)
+  emit(2,-4)
+  emit(3,23)
+}, beam.Impulse(s))
+```
+
+And replace `stats.Sum` on `stats.SumPerKey` it will output the sum by key.
+{{end}}
+{{if (eq .Sdk "java")}}
+`Sum.integersGlobally` returns the sum from the `PCollection`. If you replace the `integers input` with this `map input`:
+
+```
+PCollection<KV<Integer, Integer>> input = pipeline.apply(
+    Create.of(KV.of(1, 11),
+    KV.of(1, 36),
+    KV.of(2, 91),
+    KV.of(3, 33),
+    KV.of(3, 11),
+    KV.of(4, 33)));
+```
+
+And replace `Sum.integersGlobally` on `Sum.integersPerKey` it will output the sum by key. It is also necessary to replace the generic type:
+
+```
+PCollection<KV<Integer, Integer>> output = applyTransform(input);
+```
+
+```
+static PCollection<KV<Integer, Integer>> applyTransform(PCollection<KV<Integer, Integer>> input) {
+        return input.apply(Sum.integersPerKey());
+    }
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+`beam.CombineGlobally(sum)` returns sum from `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.CombineGlobally(sum)` on `beam.CombinePerKey(sum)` it will output the sum by key :

Review Comment:
   `beam.CombineGlobally(sum)` returns the sum of values in the `PCCollection`. If you replace the `integers input` with this `map input` and replace `beam.CombineGlobally(sum)` with `beam.CombinePerKey(sum)` it will output the sum by key :



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.
+
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/fbeam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/filter"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return filter.Exclude(s, input, func(element int) bool {
+    return element % 2 == 1
+  })
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+PCollection<String> allStrings = pipeline
+        .apply(Create.of(List.of("Hello","world","Hi")));
+
+PCollection<String> filteredStrings = allStrings
+        .apply(Filter.by(new SerializableFunction<String, Boolean>() {
+            @Override
+            public Boolean apply(String input) {
+                return input.length() > 3;
+            }
+        }));
+```
+
+Output
+
+```
+Hello
+world
+```
+
+### Built-in filters
+
+The Java SDK has several filter methods built-in, like Filter.greaterThan and Filter.lessThen.  With Filter.greaterThan, the input PCollection can be filtered so that only the elements whose values are greater than the specified amount remain. Similarly, you can use Filter.lessThen to filter out elements of the input PCollection whose values are greater than the specified amount.
+
+Other built-in filters are:
+
+* Filter.greaterThanEq
+* Filter.greaterThan
+* Filter.lessThan
+* Filter.lessThanEq
+* Filter.equal
+
+
+## Example 2: Filtering with a built-in methods
+
+```
+// List of integers
+PCollection<Integer> numbers = pipeline.apply(Create.of(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));
+
+// PCollection will contain [3, 4, 5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanEqNumbers = pipeline.apply(Filter.greaterThanEq(3));
+
+
+// PCollection will contain [5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanNumbers = pipeline.apply(Filter.greaterThan(4));
+
+
+// PCollection will contain [1, 2, 3, 4, 5, 6, 7, 8, 9] at this point
+PCollection<Integer> lessThanNumbers = pipeline.apply(Filter.lessThan(10));
+
+
+// PCollection will contain [1, 2, 3, 4 5, 6, 7] at this point
+PCollection<Integer> lessThanEqNumbers = pipeline.apply(Filter.lessThanEq(7));
+
+
+// PCollection will contain [9] at this point
+PCollection<Integer> equalNumbers = pipeline.apply(Filter.equal(9));
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+```
+import apache_beam as beam
+
+from log_elements import LogElements
+
+with beam.Pipeline() as p:
+  (p | beam.Create(range(1, 11))
+     | beam.Filter(lambda num: num % 2 == 0)
+     | LogElements())
+```
+
+
+### Example 1: Filtering with a function
+
+You can define a function `is_perennial()` which returns True if the element’s duration equals 'perennial', and False otherwise.
+
+```
+import apache_beam as beam
+
+def is_perennial(plant):
+  return plant['duration'] == 'perennial'
+
+with beam.Pipeline() as pipeline:
+  perennials = (
+      pipeline

Review Comment:
   use p



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.
+
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/fbeam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/filter"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return filter.Exclude(s, input, func(element int) bool {
+    return element % 2 == 1
+  })
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+PCollection<String> allStrings = pipeline
+        .apply(Create.of(List.of("Hello","world","Hi")));
+
+PCollection<String> filteredStrings = allStrings
+        .apply(Filter.by(new SerializableFunction<String, Boolean>() {
+            @Override
+            public Boolean apply(String input) {
+                return input.length() > 3;
+            }
+        }));
+```
+
+Output
+
+```
+Hello
+world
+```
+
+### Built-in filters
+
+The Java SDK has several filter methods built-in, like Filter.greaterThan and Filter.lessThen.  With Filter.greaterThan, the input PCollection can be filtered so that only the elements whose values are greater than the specified amount remain. Similarly, you can use Filter.lessThen to filter out elements of the input PCollection whose values are greater than the specified amount.
+
+Other built-in filters are:
+
+* Filter.greaterThanEq
+* Filter.greaterThan
+* Filter.lessThan
+* Filter.lessThanEq
+* Filter.equal
+
+
+## Example 2: Filtering with a built-in methods
+
+```
+// List of integers
+PCollection<Integer> numbers = pipeline.apply(Create.of(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));

Review Comment:
   numbers -> input



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.
+
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/fbeam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/filter"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return filter.Exclude(s, input, func(element int) bool {
+    return element % 2 == 1
+  })
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+PCollection<String> allStrings = pipeline
+        .apply(Create.of(List.of("Hello","world","Hi")));
+
+PCollection<String> filteredStrings = allStrings
+        .apply(Filter.by(new SerializableFunction<String, Boolean>() {
+            @Override
+            public Boolean apply(String input) {
+                return input.length() > 3;
+            }
+        }));
+```
+
+Output
+
+```
+Hello
+world
+```
+
+### Built-in filters
+
+The Java SDK has several filter methods built-in, like Filter.greaterThan and Filter.lessThen.  With Filter.greaterThan, the input PCollection can be filtered so that only the elements whose values are greater than the specified amount remain. Similarly, you can use Filter.lessThen to filter out elements of the input PCollection whose values are greater than the specified amount.
+
+Other built-in filters are:
+
+* Filter.greaterThanEq
+* Filter.greaterThan
+* Filter.lessThan
+* Filter.lessThanEq
+* Filter.equal
+
+
+## Example 2: Filtering with a built-in methods
+
+```
+// List of integers
+PCollection<Integer> numbers = pipeline.apply(Create.of(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));
+
+// PCollection will contain [3, 4, 5, 6, 7, 8, 9, 10] at this point

Review Comment:
   These comments should all be after the filter is applied, not before.



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.
+
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/fbeam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/filter"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return filter.Exclude(s, input, func(element int) bool {
+    return element % 2 == 1
+  })
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+PCollection<String> allStrings = pipeline
+        .apply(Create.of(List.of("Hello","world","Hi")));
+
+PCollection<String> filteredStrings = allStrings
+        .apply(Filter.by(new SerializableFunction<String, Boolean>() {
+            @Override
+            public Boolean apply(String input) {
+                return input.length() > 3;
+            }
+        }));
+```
+
+Output
+
+```
+Hello
+world
+```
+
+### Built-in filters
+
+The Java SDK has several filter methods built-in, like Filter.greaterThan and Filter.lessThen.  With Filter.greaterThan, the input PCollection can be filtered so that only the elements whose values are greater than the specified amount remain. Similarly, you can use Filter.lessThen to filter out elements of the input PCollection whose values are greater than the specified amount.
+
+Other built-in filters are:
+
+* Filter.greaterThanEq
+* Filter.greaterThan
+* Filter.lessThan
+* Filter.lessThanEq
+* Filter.equal
+
+
+## Example 2: Filtering with a built-in methods
+
+```
+// List of integers
+PCollection<Integer> numbers = pipeline.apply(Create.of(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));
+
+// PCollection will contain [3, 4, 5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanEqNumbers = pipeline.apply(Filter.greaterThanEq(3));
+
+
+// PCollection will contain [5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanNumbers = pipeline.apply(Filter.greaterThan(4));
+
+
+// PCollection will contain [1, 2, 3, 4, 5, 6, 7, 8, 9] at this point
+PCollection<Integer> lessThanNumbers = pipeline.apply(Filter.lessThan(10));
+
+
+// PCollection will contain [1, 2, 3, 4 5, 6, 7] at this point
+PCollection<Integer> lessThanEqNumbers = pipeline.apply(Filter.lessThanEq(7));
+
+
+// PCollection will contain [9] at this point
+PCollection<Integer> equalNumbers = pipeline.apply(Filter.equal(9));
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+```
+import apache_beam as beam
+
+from log_elements import LogElements
+
+with beam.Pipeline() as p:
+  (p | beam.Create(range(1, 11))
+     | beam.Filter(lambda num: num % 2 == 0)
+     | LogElements())
+```
+
+
+### Example 1: Filtering with a function
+
+You can define a function `is_perennial()` which returns True if the element’s duration equals 'perennial', and False otherwise.
+
+```
+import apache_beam as beam
+
+def is_perennial(plant):
+  return plant['duration'] == 'perennial'
+
+with beam.Pipeline() as pipeline:
+  perennials = (
+      pipeline
+      | 'Gardening plants' >> beam.Create([
+          {
+              'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ₯•', 'name': 'Carrot', 'duration': 'biennial'
+          },
+          {
+              'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ…', 'name': 'Tomato', 'duration': 'annual'
+          },
+          {
+              'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'
+          },
+      ])
+      | 'Filter perennials' >> beam.Filter(is_perennial)
+      | beam.Map(print))
+```
+
+Output
+
+```
+{'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'}
+{'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'}
+{'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'}
+```
+
+### Example 2: Filtering with a lambda function
+
+You can also use lambda functions to simplify Example 1.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  perennials = (
+      pipeline

Review Comment:
   use p



##########
learning/tour-of-beam/learning-content/common-transforms/filter/description.md:
##########
@@ -0,0 +1,421 @@
+<!--
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+### Using Filter
+
+PCollection datasets can be filtered using the Filter transform. You can create a filter by supplying a predicate and, when applied, filtering out all the elements of PCollection that don’t satisfy the predicate.
+
+{{if (eq .Sdk "go")}}
+```
+import (
+  "github.com/apache/fbeam/sdks/go/pkg/beam"
+  "github.com/apache/beam/sdks/go/pkg/beam/transforms/filter"
+)
+
+func ApplyTransform(s beam.Scope, input beam.PCollection) beam.PCollection {
+  return filter.Exclude(s, input, func(element int) bool {
+    return element % 2 == 1
+  })
+}
+```
+{{end}}
+{{if (eq .Sdk "java")}}
+```
+PCollection<String> allStrings = pipeline
+        .apply(Create.of(List.of("Hello","world","Hi")));
+
+PCollection<String> filteredStrings = allStrings
+        .apply(Filter.by(new SerializableFunction<String, Boolean>() {
+            @Override
+            public Boolean apply(String input) {
+                return input.length() > 3;
+            }
+        }));
+```
+
+Output
+
+```
+Hello
+world
+```
+
+### Built-in filters
+
+The Java SDK has several filter methods built-in, like Filter.greaterThan and Filter.lessThen.  With Filter.greaterThan, the input PCollection can be filtered so that only the elements whose values are greater than the specified amount remain. Similarly, you can use Filter.lessThen to filter out elements of the input PCollection whose values are greater than the specified amount.
+
+Other built-in filters are:
+
+* Filter.greaterThanEq
+* Filter.greaterThan
+* Filter.lessThan
+* Filter.lessThanEq
+* Filter.equal
+
+
+## Example 2: Filtering with a built-in methods
+
+```
+// List of integers
+PCollection<Integer> numbers = pipeline.apply(Create.of(List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)));
+
+// PCollection will contain [3, 4, 5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanEqNumbers = pipeline.apply(Filter.greaterThanEq(3));
+
+
+// PCollection will contain [5, 6, 7, 8, 9, 10] at this point
+PCollection<Integer> greaterThanNumbers = pipeline.apply(Filter.greaterThan(4));
+
+
+// PCollection will contain [1, 2, 3, 4, 5, 6, 7, 8, 9] at this point
+PCollection<Integer> lessThanNumbers = pipeline.apply(Filter.lessThan(10));
+
+
+// PCollection will contain [1, 2, 3, 4 5, 6, 7] at this point
+PCollection<Integer> lessThanEqNumbers = pipeline.apply(Filter.lessThanEq(7));
+
+
+// PCollection will contain [9] at this point
+PCollection<Integer> equalNumbers = pipeline.apply(Filter.equal(9));
+```
+{{end}}
+{{if (eq .Sdk "python")}}
+```
+import apache_beam as beam
+
+from log_elements import LogElements
+
+with beam.Pipeline() as p:
+  (p | beam.Create(range(1, 11))
+     | beam.Filter(lambda num: num % 2 == 0)
+     | LogElements())
+```
+
+
+### Example 1: Filtering with a function
+
+You can define a function `is_perennial()` which returns True if the element’s duration equals 'perennial', and False otherwise.
+
+```
+import apache_beam as beam
+
+def is_perennial(plant):
+  return plant['duration'] == 'perennial'
+
+with beam.Pipeline() as pipeline:
+  perennials = (
+      pipeline
+      | 'Gardening plants' >> beam.Create([
+          {
+              'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ₯•', 'name': 'Carrot', 'duration': 'biennial'
+          },
+          {
+              'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ…', 'name': 'Tomato', 'duration': 'annual'
+          },
+          {
+              'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'
+          },
+      ])
+      | 'Filter perennials' >> beam.Filter(is_perennial)
+      | beam.Map(print))
+```
+
+Output
+
+```
+{'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'}
+{'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'}
+{'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'}
+```
+
+### Example 2: Filtering with a lambda function
+
+You can also use lambda functions to simplify Example 1.
+
+```
+import apache_beam as beam
+
+with beam.Pipeline() as pipeline:
+  perennials = (
+      pipeline
+      | 'Gardening plants' >> beam.Create([
+          {
+              'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ₯•', 'name': 'Carrot', 'duration': 'biennial'
+          },
+          {
+              'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'
+          },
+          {
+              'icon': 'πŸ…', 'name': 'Tomato', 'duration': 'annual'
+          },
+          {
+              'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'
+          },
+      ])
+      | 'Filter perennials' >>
+      beam.Filter(lambda plant: plant['duration'] == 'perennial')
+      | beam.Map(print))
+```
+
+Output
+
+```
+{'icon': 'πŸ“', 'name': 'Strawberry', 'duration': 'perennial'}
+{'icon': 'πŸ†', 'name': 'Eggplant', 'duration': 'perennial'}
+{'icon': 'πŸ₯”', 'name': 'Potato', 'duration': 'perennial'}
+```
+
+### Example 3: Filtering with multiple arguments
+
+You can pass functions with multiple arguments to ```Filter```. They are passed as additional positional arguments or keyword arguments to the function.
+
+In this example, ```has_duration``` takes ```plant``` and ```duration``` as arguments.
+
+```
+import apache_beam as beam
+
+def has_duration(plant, duration):
+  return plant['duration'] == duration
+
+with beam.Pipeline() as pipeline:

Review Comment:
   use p



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org