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

lostluck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 50c4100  [BEAM-12513] Add Go to 5. pipeline io. (#15225)
50c4100 is described below

commit 50c41000f1894901942e1ea13d013c96f8486b23
Author: Robert Burke <[email protected]>
AuthorDate: Tue Jul 27 07:59:16 2021 -0700

    [BEAM-12513] Add Go to 5. pipeline io. (#15225)
---
 .../site/content/en/documentation/programming-guide.md | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/website/www/site/content/en/documentation/programming-guide.md 
b/website/www/site/content/en/documentation/programming-guide.md
index 7edcd7a..c4a3c95 100644
--- a/website/www/site/content/en/documentation/programming-guide.md
+++ b/website/www/site/content/en/documentation/programming-guide.md
@@ -2434,6 +2434,10 @@ PCollection<String> lines = 
p.apply(TextIO.read().from("gs://some/inputData.txt"
 lines = pipeline | beam.io.ReadFromText('gs://some/inputData.txt')
 {{< /highlight >}}
 
+{{< highlight go >}}
+lines :=  textio.Read(scope, 'gs://some/inputData.txt')
+{{< /highlight >}}
+
 ### 5.2. Writing output data {#pipeline-io-writing-data}
 
 Write transforms write the data in a `PCollection` to an external data source.
@@ -2449,6 +2453,10 @@ output.apply(TextIO.write().to("gs://some/outputData"));
 output | beam.io.WriteToText('gs://some/outputData')
 {{< /highlight >}}
 
+{{< highlight go >}}
+textio.Write(scope, 'gs://some/inputData.txt', output)
+{{< /highlight >}}
+
 ### 5.3. File-based input and output data {#file-based-data}
 
 #### 5.3.1. Reading from multiple locations 
{#file-based-reading-multiple-locations}
@@ -2468,6 +2476,10 @@ p.apply("ReadFromText",
 {{< code_sample "sdks/python/apache_beam/examples/snippets/snippets.py" 
model_pipelineio_read >}}
 {{< /highlight >}}
 
+{{< highlight go >}}
+lines := textio.Read(scope, "path/to/input-*.csv")
+{{< /highlight >}}
+
 To read data from disparate sources into a single `PCollection`, read each one
 independently and then use the [Flatten](#flatten) transform to create a single
 `PCollection`.
@@ -2493,6 +2505,12 @@ records.apply("WriteToText",
 {{< code_sample "sdks/python/apache_beam/examples/snippets/snippets.py" 
model_pipelineio_write >}}
 {{< /highlight >}}
 
+{{< highlight go >}}
+// The Go SDK textio doesn't support sharding on writes yet.
+// See https://issues.apache.org/jira/browse/BEAM-12664 for ways
+// to contribute a solution.
+{{< /highlight >}}
+
 ### 5.4. Beam-provided I/O transforms {#provided-io-transforms}
 
 See the [Beam-provided I/O Transforms](/documentation/io/built-in/)

Reply via email to