Re: How to split tuple2 returned by UDAF into two columns in a result table

2019-03-20 Thread Fabian Hueske
Hi Dongwon, Couldn't you just return a tuple from the aggregation function and extract the fields from the nested tuple using a value access function [1]? table table2 = table1 .window(Slide.over("3.rows").every("1.rows").on("time").as("w")) .groupBy("w, name") .select("name, my

Re: How to split tuple2 returned by UDAF into two columns in a result table

2019-03-19 Thread Dongwon Kim
Another, yet related question: Is there something like aggregate table function? In the above scenario, I have to apply an aggregate function and then apply a table function solely to flatten tuples, which seems quite inefficient. On Wed, Mar 20, 2019 at 1:09 PM Dongwon Kim wrote: > Hi Kurt,

Re: How to split tuple2 returned by UDAF into two columns in a result table

2019-03-19 Thread Dongwon Kim
Hi Kurt, You're right; It is table function like "mytablefunc(col1, col2, col3) as (col4, col5)". I've got to define a custom UDTF for that purpose. Thanks, - Dongwon On Wed, Mar 20, 2019 at 12:04 PM Kurt Young wrote: > Hi Dongwon, > > AFAIK, Flink doesn't support the usage like "myscalar(col1,

Re: How to split tuple2 returned by UDAF into two columns in a result table

2019-03-19 Thread Kurt Young
Hi Dongwon, AFAIK, Flink doesn't support the usage like "myscalar(col1, col2, col3) as (col4, col5)". Am I missing something? If you want to split Tuple2 into two different columns, you can use UDTF. Best, Kurt On Wed, Mar 20, 2019 at 9:59 AM Dongwon Kim wrote: > Hi, > > I want to split Tupl

How to split tuple2 returned by UDAF into two columns in a result table

2019-03-19 Thread Dongwon Kim
Hi, I want to split Tuple2 returned by AggregateFunction.getValue into two different columns in a resultant table. Let's consider the following example where myudaf returns Tuple2: Table table2 = table1 .window(Slide.over("3.rows").every("1.rows").on("time").as("w")) .groupBy("w,