MemonaAmirAbdulHaq commented on code in PR #37543:
URL: https://github.com/apache/beam/pull/37543#discussion_r2818691829


##########
website/www/site/content/en/documentation/programming-guide.md:
##########
@@ -4164,14 +4164,31 @@ as schema fields may have different requirements or 
restrictions from Go exporte
 
 ### 6.6. Using Schema Transforms {#using-schemas}
 
-A schema on a `PCollection` enables a rich variety of relational transforms. 
The fact that each record is composed of
-named fields allows for simple and readable aggregations that reference fields 
by name, similar to the aggregations in
-a SQL expression.
-
 {{< paragraph class="language-go">}}
-Beam does not yet support Schema transforms natively in Go. However, it will 
be implemented with the following behavior.
+In Go, schemas are inferred from struct types. You can use schema-aware
+<code>PCollection</code>s by defining structs and accessing their fields
+directly in transforms. The following example demonstrates extracting
+a nested field from a schema-aware collection.
 {{< /paragraph >}}
 
+{{< highlight go >}}
+type ShippingAddress struct {
+    PostCode string `beam:"postCode"`
+ }
+type Purchase struct {
+    ShippingAddress ShippingAddress `beam:"shippingAddress"`
+ }
+purchases := beam.Create(s,
+    Purchase{
+        ShippingAddress: ShippingAddress{PostCode: "12345"},
+    },
+ )
+postCodes := beam.ParDo(s, func(p Purchase) string {
+    return p.ShippingAddress.PostCode

Review Comment:
   Thanks for the feedback. I've restored the original schema description .



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to