How to compare two window ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to compare two window ?

苗元君
Hi, Flink guys, 
U really to a quick release, it's fantastic ! 

I'v got a situation , 
window 1 is time driven, slice is 1min, trigger is 1 count
window 2 is count driven, slice is 3 count, trigger is 1count

1. Then element is out of window1 and just right into window2. 
    For example if there is only 2 element, window2 will have none element.  how to build window like this ? 
   I try to use window1 by structure (window trigger evictor) then window2 structure(trigger evictor)
   I got element calculate just in window1 and window2 in the same time

2.  I try to find ways to use SQL on AllWindowedStream but seem not working. Can SQL Query use on a WINDOW ?
3.  How to compare these SQL result ?


image.png

Thank U so much.

--

Yuanjun Miao

Reply | Threaded
Open this post in threaded view
|

Re: How to compare two window ?

Hequn Cheng
Hi miaoyuan,

> First question
I didn't quite catch your meaning. There are some documents about using window in sql[1] or table-api[2] and it is worth to take a look.

> Second question
Group by window without other keys results a AllWindowedStream. Sql like bellow:
SELECT COUNT(*)
, TUMBLE_START(rowtime, INTERVAL '15' MINUTE)
, TUMBLE_END(rowtime, INTERVAL '15' MINUTE)
FROM MyTable
GROUP BY TUMBLE(rowtime, INTERVAL '15' MINUTE)

> Third question
You can print or sink data into external storages and compare the result.

Best, Hequn


On Thu, Aug 16, 2018 at 2:26 PM, 苗元君 <[hidden email]> wrote:
Hi, Flink guys, 
U really to a quick release, it's fantastic ! 

I'v got a situation , 
window 1 is time driven, slice is 1min, trigger is 1 count
window 2 is count driven, slice is 3 count, trigger is 1count

1. Then element is out of window1 and just right into window2. 
    For example if there is only 2 element, window2 will have none element.  how to build window like this ? 
   I try to use window1 by structure (window trigger evictor) then window2 structure(trigger evictor)
   I got element calculate just in window1 and window2 in the same time

2.  I try to find ways to use SQL on AllWindowedStream but seem not working. Can SQL Query use on a WINDOW ?
3.  How to compare these SQL result ?


image.png

Thank U so much.

--

Yuanjun Miao


Reply | Threaded
Open this post in threaded view
|

Re: How to compare two window ?

Piotr Nowojski
In reply to this post by 苗元君
Hi,

Could you rephrase your question? Maybe by posting some code examples?

Piotrek

On 16 Aug 2018, at 08:26, 苗元君 <[hidden email]> wrote:

Hi, Flink guys, 
U really to a quick release, it's fantastic ! 

I'v got a situation , 
window 1 is time driven, slice is 1min, trigger is 1 count
window 2 is count driven, slice is 3 count, trigger is 1count

1. Then element is out of window1 and just right into window2. 
    For example if there is only 2 element, window2 will have none element.  how to build window like this ? 
   I try to use window1 by structure (window trigger evictor) then window2 structure(trigger evictor)
   I got element calculate just in window1 and window2 in the same time

2.  I try to find ways to use SQL on AllWindowedStream but seem not working. Can SQL Query use on a WINDOW ?
3.  How to compare these SQL result ?


<image.png>

Thank U so much.

--

Yuanjun Miao