Let's say I have PCollection<A> and I want to use the 'readAll' pattern to
enhance some data from an additional source such as redis (which has a
readKeys PTransform<String, RedisData>).  However I don't want to 'lose'
the original A.  There *are* a few ways to do this currently (side inputs,
joining two streams with CoGroupByKey, using State) all of which have some
problems.

If I could map PCollection<A> into some type that has <A, String> for
instance PCollection<KV<A, String>>, then use the redis readKeys to map to
PCollection<KV<A, RedisData>> this solves all my problems. This is more or
less a get/set lens optic if anyone is familiar with functional
programming.

Is something like this possible?  Could it be added?  I've run into wanting
this pattern numerous times over the last year.


*~Vincent*

Reply via email to