You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "Aris Koliopoulos (Jira)" <ji...@apache.org> on 2021/02/19 17:07:00 UTC

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

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)