Re: Getting Window information from coGroup functin

Posted by Arvid Heise-3 on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Getting-Window-information-from-coGroup-functin-tp35602p35748.html

Hi Sudan,

it seems to be unsupported directly.

You can have a hacky workaround by replicating apply[1] in your code and adjust the last line to call your CoGroupWindowFunction.

[1] https://github.com/apache/flink/blob/aedb4068408cfcad6f258526b00fcbff7f40fb82/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/CoGroupedStreams.java#L325-L359

On Thu, Jun 4, 2020 at 10:09 AM Dawid Wysakowicz <[hidden email]> wrote:

I am afraid there is no way to do that. At least I could not think of a way to do it.

Maybe @aljoscha cc'ed could help here.

On 29/05/2020 13:25, Sudan S wrote:
Hi,

I have a usecase where i want to join two streams. I am using coGroup for this

KeyBuilder leftKey = new KeyBuilder(jobConfiguration.getConnectStream().getLeftKey());
KeyBuilder rightKey = new KeyBuilder(jobConfiguration.getConnectStream().getRightKey());
leftSource.coGroup(rightSource).where(leftKey).equalTo(rightKey)
          .window(...)
          .apply()
          .addSink(...);

For apply method i'm using RichCoGroupFunction. I am not able to find access to Window object similar to
ProcessWindowFunction. I would be interested in extracting start time, end time and key of the window
Plz suggest if there are any alternatives


"The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by replying to this e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business."


--

Arvid Heise | Senior Java Developer


Follow us @VervericaData

--

Join Flink Forward - The Apache Flink Conference

Stream Processing | Event Driven | Real Time

--

Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany

--

Ververica GmbH
Registered at Amtsgericht Charlottenburg: HRB 158244 B
Managing Directors: Timothy Alexander Steinert, Yip Park Tung Jason, Ji (Toni) Cheng