You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "twang126 (via GitHub)" <gi...@apache.org> on 2023/04/28 17:04:54 UTC

[GitHub] [beam] twang126 commented on a diff in pull request #26451: Add flexible windowing syntax to yaml.

twang126 commented on code in PR #26451:
URL: https://github.com/apache/beam/pull/26451#discussion_r1180636363


##########
sdks/python/apache_beam/yaml/README.md:
##########
@@ -215,6 +215,157 @@ pipeline:
       path: /path/to/big.csv
 ```
 
+## Windowing
+
+This API can be used to define both streaming and batch pipelines.
+In order to meaningfully aggregate elements in a streaming pipeline,
+some kind of windowing is typically required. Beam's
+[windowing](https://beam.apache.org/documentation/programming-guide/#windowing)
+and [triggering](https://beam.apache.org/documentation/programming-guide/#triggers)
+can be be declared using the same WindowInto transform available in all other
+SDKs.
+
+```
+pipeline:
+  type: chain
+  transforms:
+    - type: ReadFromPubSub
+      topic: myPubSubTopic
+    - type: WindowInto
+      windowing:
+        type: fixed
+        size: 60
+    - type: SomeAggregation
+    - type: WriteToPubSub
+      topic: anotherPubSubTopic
+```
+
+Rather than using an explicit `WindowInto` operation, one may instead tag a
+transform itself with a specified windowing which will cause its inputs
+(and hence the transform itself) to be applied with that windowing.
+
+```
+pipeline:
+  type: chain
+  transforms:
+    - type: ReadFromPubSub
+      topic: myPubSubTopic
+    - type: SomeAggregation
+      windowing:
+        type: sliding
+        size: 60
+        period: 10
+    - type: WriteToPubSub
+      topic: anotherPubSubTopic
+```
+
+Note that the `Sql` operation itself often a from of aggregation, and applying

Review Comment:
   nit: maybe reword to `Note that the `Sql` operation itself  **is** often a from of aggregation, and applying a windowing ~which~ will cause all grouping to be done per window.` 



-- 
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