[jira] [Created] (FLINK-21421) Add coMapWithState to ConnnectedStreams

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-21421) Add coMapWithState to ConnnectedStreams

Shang Yuanchun (Jira)
Aris Koliopoulos created FLINK-21421:
----------------------------------------

             Summary: Add coMapWithState to ConnnectedStreams
                 Key: FLINK-21421
                 URL: https://issues.apache.org/jira/browse/FLINK-21421
             Project: Flink
          Issue Type: New Feature
          Components: API / Scala
            Reporter: Aris Koliopoulos


Currently there is no syntactic sugar for stateful functions in `ConnectedStreams` in Scala. 

This makes stateful joins (aka `connect`) more verbose and exposes users to Java interfaces (by requiring a `RichCoMapFunction` implementation to access state in `ConnectedStreams`).

Looking at DriveTribe's codebase, we have implemented ~80% of our ConnectedStreams operators using this `coMapWithState` implementation:

[https://github.com/ariskk/flink-stream-join/blob/main/src/main/scala/com/ariskk/streamjoin/ConnectedStreamsOps.scala#L15]

A `coFlatMapWithState` can be trivially implemented on top.

This has been in production for so long I forgot it was our code and not Flink's.

I can easily add it if this is of interest. No worries if not.

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)