You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by "T, Yadhunath" <Ya...@boarshead.com> on 2023/12/14 14:35:59 UTC

Event stuck in the Flink operator

Hi,

I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.

Thanks,
Yad

Re: Event stuck in the Flink operator

Posted by "T, Yadhunath" <Ya...@boarshead.com>.
Hi Alex,

Thanks for the reply!

I have 3 Flink SQL table which is joined using temporal join.
I am using the timestamp field in the first table as the event time attribute.

eg:

SELECT * FROM
TABLE1  T1
LEFT JOIN TABLE2 FOR SYSTEM_TIME AS OF T1.timestamp  as T2          -- Temporal join
ON *JOIN CONDITION*
LEFT JOIN TABLE3 FOR SYSTEM_TIME AS OF T1.timestamp  AS T3         -- Temporal join
ON  *JOIN CONDITION*

Note:
We are not using the session window/ process function for this use case.

Thanks,
Yad
________________________________
From: Alex Cruise <al...@cluonflux.com>
Sent: Friday, December 15, 2023 2:08 AM
To: T, Yadhunath <Ya...@boarshead.com>
Cc: user@flink.apache.org <us...@flink.apache.org>; Shames, Joy <Jo...@boarshead.com>; Maj, Marek <Ma...@boarshead.com>; Kornegay, Robert <Ro...@boarshead.com>; Michael, Dennis <De...@boarshead.com>; Kerelli, Sharath <Sh...@boarshead.com>
Subject: Re: Event stuck in the Flink operator

Can you share your precise join semantics? I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API: * use the Session Window join type, which automatically closes a window after
ZjQcmQRYFpfptBannerStart
This Message Is From an Untrusted Sender
"Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.

ZjQcmQRYFpfptBannerEnd
Can you share your precise join semantics?

I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:

* use the Session Window join<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/joining/*session-window-join__;Iw!!KtM2tloZCg!v4NwvO28vhpzMxtkBn1_q0YEoTChPz_XKbzWwLEVVQKVwjGegR-rwFlsJ6md14HsOiK5BkmrAb7FRX7AinU$> type, which automatically closes a window after a configurable delay since the last record
* if you're using a ProcessFunction (very low-level), you can set a timer<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/process_function/*timers__;Iw!!KtM2tloZCg!v4NwvO28vhpzMxtkBn1_q0YEoTChPz_XKbzWwLEVVQKVwjGegR-rwFlsJ6md14HsOiK5BkmrAb7Fc7_URkc$> if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)

-0xe1a

On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com>> wrote:

Hi,

I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.

Thanks,
Yad

Re: Re:Re: Re:Re: Event stuck in the Flink operator

Posted by Martijn Visser <ma...@apache.org>.
Hi,

If there's nothing that pushes the watermark forward, then the window
won't be able to close. That's a common thing and expected for every
operator that relies on watermarks. You can also decide to configure
an idleness in order to push the watermark forward if needed.

Best regards,

Martijn

On Tue, Dec 19, 2023 at 9:51 AM T, Yadhunath <Ya...@boarshead.com> wrote:
>
> Hi Xuyang,
>
> Thanks for the reply!
> I haven't used a print connector yet.
>
>
> Thanks,
> Yad
>
> ________________________________
> From: Xuyang <xy...@163.com>
> Sent: Monday, December 18, 2023 8:26 AM
> To: T, Yadhunath <Ya...@boarshead.com>
> Cc: user@flink.apache.org <us...@flink.apache.org>
> Subject: Re:Re: Re:Re: Event stuck in the Flink operator
>
> This Message Is From an Untrusted Sender
> "Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.
>
> Hi, Yad.
> These SQLs seem to be fine. Have you tried using the print connector as a sink to test whether there is any problem?
> If everything goes fine with print sink, then the problem occurs on the kafka sink.
>
>
> --
>
>     Best!
>     Xuyang
>
>
> 在 2023-12-15 18:48:45,"T, Yadhunath" <Ya...@boarshead.com> 写道:
>
> Hi Xuyang,
>
> Thanks for the reply!
>
> I don't have any dataset to share with you at this time.
>
> The last block in the Flink pipeline performs 2 functions -  temporal join( 2nd temporal join) and writing data into the sink topic.
>
> This is what Flink SQL code looks like -
>
> SELECT * FROM
> TABLE1  T1
> LEFT JOIN TABLE2 FOR SYSTEM_TIME AS OF T1.timestamp  as T2          -- Temporal join
> ON *JOIN CONDITION*
> LEFT JOIN TABLE3 FOR SYSTEM_TIME AS OF T1.timestamp  AS T3         -- Temporal join
> ON  *JOIN CONDITION*
>
> Thanks,
> Yad
> ________________________________
> From: Xuyang <xy...@163.com>
> Sent: Friday, December 15, 2023 9:33 AM
> To: user@flink.apache.org <us...@flink.apache.org>
> Subject: Re:Re: Event stuck in the Flink operator
>
> This Message Is From an Untrusted Sender
> "Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.
>
> Hi, Yad.
>
> Can you share the smallest set of sql that can reproduce this problem?
>
> BTW, the last flink operator you mean is the sink with kafka connector?
>
>
>
> --
>
>     Best!
>     Xuyang
>
>
> 在 2023-12-15 04:38:21,"Alex Cruise" <al...@cluonflux.com> 写道:
>
> Can you share your precise join semantics?
>
> I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:
>
> * use the Session Window join type, which automatically closes a window after a configurable delay since the last record
> * if you're using a ProcessFunction (very low-level), you can set a timer if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)
>
> -0xe1a
>
> On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com> wrote:
>
>
> Hi,
>
> I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
> Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
> Really appreciate if someone could advise a solution for this.
> Please let me know if you require more input.
>
> Thanks,
> Yad

Re: Re:Re: Re:Re: Event stuck in the Flink operator

Posted by "T, Yadhunath" <Ya...@boarshead.com>.
Hi Xuyang,

Thanks for the reply!
I haven't used a print connector yet.


Thanks,
Yad

________________________________
From: Xuyang <xy...@163.com>
Sent: Monday, December 18, 2023 8:26 AM
To: T, Yadhunath <Ya...@boarshead.com>
Cc: user@flink.apache.org <us...@flink.apache.org>
Subject: Re:Re: Re:Re: Event stuck in the Flink operator

This Message Is From an Untrusted Sender
"Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.

Hi, Yad.
These SQLs seem to be fine. Have you tried using the print connector as a sink to test whether there is any problem?
If everything goes fine with print sink, then the problem occurs on the kafka sink.


--

    Best!
    Xuyang


在 2023-12-15 18:48:45,"T, Yadhunath" <Ya...@boarshead.com> 写道:

Hi Xuyang,

Thanks for the reply!

I don't have any dataset to share with you at this time.

The last block in the Flink pipeline performs 2 functions -  temporal join( 2nd temporal join) and writing data into the sink topic.

This is what Flink SQL code looks like -

SELECT * FROM
TABLE1  T1
LEFT JOIN TABLE2 FOR SYSTEM_TIME AS OF T1.timestamp  as T2          -- Temporal join
ON *JOIN CONDITION*
LEFT JOIN TABLE3 FOR SYSTEM_TIME AS OF T1.timestamp  AS T3         -- Temporal join
ON  *JOIN CONDITION*

Thanks,
Yad
________________________________
From: Xuyang <xy...@163.com>
Sent: Friday, December 15, 2023 9:33 AM
To: user@flink.apache.org <us...@flink.apache.org>
Subject: Re:Re: Event stuck in the Flink operator

This Message Is From an Untrusted Sender
"Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.

Hi, Yad.

Can you share the smallest set of sql that can reproduce this problem?

BTW, the last flink operator you mean is the sink with kafka connector?



--

    Best!
    Xuyang


在 2023-12-15 04:38:21,"Alex Cruise" <al...@cluonflux.com> 写道:

Can you share your precise join semantics?

I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:

* use the Session Window join<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/joining/*session-window-join__;Iw!!KtM2tloZCg!uiRCPr9yeK3PN4HKfOdb19KvOLh7poLXLzIj4OT8a6vIDR_K5ns3OqUc_4CxFkxhOJoH2zfpV_RN_oFRnT8JX84$> type, which automatically closes a window after a configurable delay since the last record
* if you're using a ProcessFunction (very low-level), you can set a timer<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/process_function/*timers__;Iw!!KtM2tloZCg!uiRCPr9yeK3PN4HKfOdb19KvOLh7poLXLzIj4OT8a6vIDR_K5ns3OqUc_4CxFkxhOJoH2zfpV_RN_oFReMavaGE$> if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)

-0xe1a

On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com>> wrote:

Hi,

I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.

Thanks,
Yad

Re:Re: Re:Re: Event stuck in the Flink operator

Posted by Xuyang <xy...@163.com>.
Hi, Yad.
These SQLs seem to be fine. Have you tried using the print connector as a sink to test whether there is any problem?
If everything goes fine with print sink, then the problem occurs on the kafka sink.




--

    Best!
    Xuyang




在 2023-12-15 18:48:45,"T, Yadhunath" <Ya...@boarshead.com> 写道:

Hi Xuyang,


Thanks for the reply!


I don't have any dataset to share with you at this time.


The last block in the Flink pipeline performs 2 functions -  temporal join( 2nd temporal join) and writing data into the sink topic.


This is what Flink SQL code looks like - 


SELECT * FROM
TABLE1  T1
LEFT JOIN TABLE2 FOR SYSTEM_TIME AS OF T1.timestamp  as T2          -- Temporal join
ON *JOIN CONDITION*
LEFT JOIN TABLE3 FOR SYSTEM_TIME AS OF T1.timestamp  AS T3         -- Temporal join 
ON  *JOIN CONDITION*


Thanks,
Yad
From: Xuyang <xy...@163.com>
Sent: Friday, December 15, 2023 9:33 AM
To: user@flink.apache.org <us...@flink.apache.org>
Subject: Re:Re: Event stuck in the Flink operator
 
This Message Is From an Untrusted Sender
"Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.
 
Hi, Yad.


Can you share the smallest set of sql that can reproduce this problem?


BTW, the last flink operator you mean is the sink with kafka connector? 







--

    Best!
    Xuyang




在 2023-12-15 04:38:21,"Alex Cruise" <al...@cluonflux.com> 写道:

Can you share your precise join semantics? 


I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:

* use the Session Window join type, which automatically closes a window after a configurable delay since the last record
* if you're using a ProcessFunction (very low-level), you can set a timer if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)


-0xe1a


On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com> wrote:


Hi,


I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.


Thanks,
Yad

Re: Re:Re: Event stuck in the Flink operator

Posted by "T, Yadhunath" <Ya...@boarshead.com>.
Hi Xuyang,

Thanks for the reply!

I don't have any dataset to share with you at this time.

The last block in the Flink pipeline performs 2 functions -  temporal join( 2nd temporal join) and writing data into the sink topic.

This is what Flink SQL code looks like -

SELECT * FROM
TABLE1  T1
LEFT JOIN TABLE2 FOR SYSTEM_TIME AS OF T1.timestamp  as T2          -- Temporal join
ON *JOIN CONDITION*
LEFT JOIN TABLE3 FOR SYSTEM_TIME AS OF T1.timestamp  AS T3         -- Temporal join
ON  *JOIN CONDITION*

Thanks,
Yad
________________________________
From: Xuyang <xy...@163.com>
Sent: Friday, December 15, 2023 9:33 AM
To: user@flink.apache.org <us...@flink.apache.org>
Subject: Re:Re: Event stuck in the Flink operator

This Message Is From an Untrusted Sender
"Caution" You have not previously corresponded with this sender. If you do not recognize this send, verify their identity offline. If the message appears suspicious, please click the "Report Phish" button in your Outlook client.

Hi, Yad.

Can you share the smallest set of sql that can reproduce this problem?

BTW, the last flink operator you mean is the sink with kafka connector?



--

    Best!
    Xuyang


在 2023-12-15 04:38:21,"Alex Cruise" <al...@cluonflux.com> 写道:

Can you share your precise join semantics?

I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:

* use the Session Window join<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/joining/*session-window-join__;Iw!!KtM2tloZCg!uiRCPr9yeK3PN4HKfOdb19KvOLh7poLXLzIj4OT8a6vIDR_K5ns3OqUc_4CxFkxhOJoH2zfpV_RN_oFRnT8JX84$> type, which automatically closes a window after a configurable delay since the last record
* if you're using a ProcessFunction (very low-level), you can set a timer<https://urldefense.com/v3/__https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/process_function/*timers__;Iw!!KtM2tloZCg!uiRCPr9yeK3PN4HKfOdb19KvOLh7poLXLzIj4OT8a6vIDR_K5ns3OqUc_4CxFkxhOJoH2zfpV_RN_oFReMavaGE$> if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)

-0xe1a

On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com>> wrote:

Hi,

I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.

Thanks,
Yad

Re:Re: Event stuck in the Flink operator

Posted by Xuyang <xy...@163.com>.
Hi, Yad.


Can you share the smallest set of sql that can reproduce this problem?


BTW, the last flink operator you mean is the sink with kafka connector? 







--

    Best!
    Xuyang




在 2023-12-15 04:38:21,"Alex Cruise" <al...@cluonflux.com> 写道:

Can you share your precise join semantics? 


I don't know about Flink SQL offhand, but here are a couple ways to do this when you're using the DataStream API:

* use the Session Window join type, which automatically closes a window after a configurable delay since the last record
* if you're using a ProcessFunction (very low-level), you can set a timer if you need to react to the non-arrival of data. Just make sure you cancel it when data finally does arrive. :)


-0xe1a


On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com> wrote:



Hi,


I am using Flink version 1.16 and I have a streaming job that uses PyFlinkSQL API.
Whenever a new streaming event comes in it is not getting processed in the last Flink operator  ( it performs temporal join along with writing data into Kafka topic) and it will be only pushed to Kafka on the arrival of the next streaming event. It is like the last operator needs an event to process the previous event. Did anyone experience a similar issue?
Really appreciate if someone could advise a solution for this.
Please let me know if you require more input.


Thanks,
Yad

Re: Event stuck in the Flink operator

Posted by Alex Cruise <al...@cluonflux.com>.
Can you share your precise join semantics?

I don't know about Flink SQL offhand, but here are a couple ways to do this
when you're using the DataStream API:

* use the Session Window join
<https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/joining/#session-window-join>
type, which automatically closes a window after a configurable delay since
the last record
* if you're using a ProcessFunction (very low-level), you can set a timer
<https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/operators/process_function/#timers>
if you need to react to the non-arrival of data. Just make sure you cancel
it when data finally does arrive. :)

-0xe1a

On Thu, Dec 14, 2023 at 6:36 AM T, Yadhunath <Ya...@boarshead.com>
wrote:

>
> Hi,
>
> I am using Flink version 1.16 and I have a streaming job that uses
> PyFlinkSQL API.
> Whenever a new streaming event comes in it is not getting processed in the
> last Flink operator  ( it performs temporal join along with writing data
> into Kafka topic) and it will be only pushed to Kafka on the arrival of the
> next streaming event. It is like the last operator needs an event to
> process the previous event. Did anyone experience a similar issue?
> Really appreciate if someone could advise a solution for this.
> Please let me know if you require more input.
>
> Thanks,
> Yad
>