Skip to content

Commit

Permalink
Add more links
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcavazos committed Oct 19, 2020
1 parent eaff2e9 commit 26a2a04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions website/www/site/content/en/get-started/from-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,16 @@ sc = pyspark.SparkContext()
values = sc.parallelize([1, 2, 3, 4])
total = values.reduce(lambda x, y: x + y)

# We can simply use `total` since it's already a Python value from `reduce`.
# We can simply use `total` since it's already a Python `int` value from `reduce`.
scaled_values = values.map(lambda x: x / total)

# But to access `scaled_values`, we need to call `collect`.
print(scaled_values.collect())
{{< /highlight >}}

In Beam the results from _all_ transforms result in a PCollection.
We use _side inputs_ to feed a PCollection into a transform and access its values.
We use [_side inputs_](/documentation/programming-guide/#side-inputs)
to feed a PCollection into a transform and access its values.

Any transform that accepts a function, like
[`Map`](/documentation/transforms/python/elementwise/map),
Expand Down

0 comments on commit 26a2a04

Please sign in to comment.