Hello,

I'm a little confused on the Joining clicks and views
<https://beam.apache.org/documentation/programming-guide/#state-timers-examples>
example in
the documentation. I was wondering if I could get some help.

The example starts with the following snippet of code:

PCollection<KV<String, Event>> eventsPerLinkId =
    readEvents()
    
.apply(WithKeys.of(Event::getLinkId).withKeyType(TypeDescriptors.strings()));
perUser.apply(ParDo.of(new DoFn<KV<String, Event>, JoinedEvent>() {
    ...
}));


The example does not show how the `perUser` PCollection is generated or
where the `eventsPerLinkId` PCollection is used.

How are the two streams, views and clicks, being joined into a single
PCollection? Would it be optimal to use the `Flatten` transformation? I'm
confused on the steps necessary between reading from two streams to
processing on a single stream.

Best,
Hubert

Reply via email to