Ardagan commented on a change in pull request #11182: [BEAM-9650] Add
PeriodicImpulse Transform and slowly changing side input documentation
URL: https://github.com/apache/beam/pull/11182#discussion_r408337414
##########
File path: website/src/documentation/patterns/side-inputs.md
##########
@@ -45,4 +45,30 @@ For instance, the following code sample uses a `Map` to
create a `DoFn`. The `Ma
```java
{% github_sample
/apache/beam/blob/master/examples/java/src/main/java/org/apache/beam/examples/snippets/Snippets.java
tag:SideInputPatternSlowUpdateGlobalWindowSnip1
%}
-```
\ No newline at end of file
+```
+
+
+## Slowly updating side input using windowing
+
+You can read side input pcollection periodically into distinct windows.
+Later, when you apply side input to your main input, windows will be matched
automatically 1:1.
+This way, you can guarantee side input consistency on the duration of the
single window.
+
+To do this, you can utilize PeriodicSequence PTransform that will generate
infinite sequence
+of elements with some real-time period:
+
+1. Use the PeriodicImpulse transform to genearate windowed periodic sequence.
+
+ a. MAX_TIMESTAMP can be replaced with some closer boundary if you want to
stop generating elements at some point.
+
+1. Read data using Read operation triggered by arrival of PCollection element.
+
+1. Apply side input.
+
+```python
+{% github_sample
/apache/beam/blob/master/sdks/python/apache_beam/examples/snippets/snippets.py
tag:SideInputSlowUpdateSnip1
+%}
Review comment:
Addressed here: https://github.com/apache/beam/pull/11415
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services