Re: Custom Trigger + SQL Pattern

2018-10-26 Thread shkob1
following up on the actual question - is there a way to register a keyedstream as table(s) and have a trigger per key? -- Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

Re: Custom Trigger + SQL Pattern

2018-10-19 Thread Shahar Cizer Kobrinsky
Thanks for the answer Hequn! To be honest im still trying to wrap my head around this solution, also trying to think whether it has advantages over my solution. My original thought was that my design is "backwards" because logically i would want to 1. collect raw records 2. partition them b

Re: Custom Trigger + SQL Pattern

2018-10-16 Thread Hequn Cheng
Hi Shahar, The table function takes a single row but can output multi rows. You can split the row based on the "last" event. The code looks like: val sessionResult = > "SELECT " + > " lastUDAF(line) AS lastEvents " > "FROM MyTable " + > "GROUP BY SESSION(rowtime

Re: Custom Trigger + SQL Pattern

2018-10-16 Thread Shahar Cizer Kobrinsky
Im wondering how does that work, it seems that a table function still takes a single row's values as an input, am i wrong (or at least that is how the examples show)? How would the SQL look like? On Fri, Oct 12, 2018 at 9:15 PM Hequn Cheng wrote: > Hi shkob1, > > > while one is time(session inac

Re: Custom Trigger + SQL Pattern

2018-10-12 Thread Hequn Cheng
Hi shkob1, > while one is time(session inactivity) the other is based on a specific event marked as a "last" event. How about using a session window and an udtf[1] to solve the problem. The session window may output multi `last` elements. However, we can use a udtf to split them into single ones.