You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Dawid Wysakowicz <dw...@apache.org> on 2020/06/04 08:09:37 UTC

Re: Getting Window information from coGroup functin

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."/
> ------------------------------------------------------------------------

Re: Getting Window information from coGroup functin

Posted by Arvid Heise <ar...@ververica.com>.
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 <dw...@apache.org>
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

<https://www.ververica.com/>

Follow us @VervericaData

--

Join Flink Forward <https://flink-forward.org/> - 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