Re: Built-in functions to manipulate MULTISET type

2021-09-21 Thread Francesco Guardiani
Hi, for type strategies you can check out org.apache.flink.table.types.inference.InputTypeStrategies. They are pretty extensive and widely covers most use cases. In your case, this function probably requires the COMMON type strategy. If you want to roll out your own type inference, look at the org.

Re: Built-in functions to manipulate MULTISET type

2021-09-20 Thread Seth Wiesman
The type strategy can be generic over the input and output types, so you can write something generic that say given a multiset of some type T this function returns an array of some type T. This is the exact same logic built-in functions use and is just as expressive as anything Flink could provide.

Re: Built-in functions to manipulate MULTISET type

2021-09-19 Thread Kai Fu
Hi Seth, This is really helpful and inspiring, thank you for the information. On Sun, Sep 19, 2021 at 11:06 PM Seth Wiesman wrote: > Hi, > > I agree it would be great to see these functions built-in, but you do not > need to write a UDF for each type. You can overload a UDFs type inference > an

Re: Built-in functions to manipulate MULTISET type

2021-09-19 Thread Yuval Itzchakov
Hi Seth, You're right, but you still have to roll your own type inference for all supported types you want, which isn't terrible but not ideal. On Sun, Sep 19, 2021, 18:06 Seth Wiesman wrote: > Hi, > > I agree it would be great to see these functions built-in, but you do not > need to write a U

Re: Built-in functions to manipulate MULTISET type

2021-09-19 Thread Seth Wiesman
Hi, I agree it would be great to see these functions built-in, but you do not need to write a UDF for each type. You can overload a UDFs type inference and have the same capabilities as built-in functions, which means supporting generics. https://github.com/apache/flink/blob/master/flink-examples

Re: Built-in functions to manipulate MULTISET type

2021-09-18 Thread Yuval Itzchakov
Hi Jing, I recall there is already an open ticket for built-in aggregate functions On Sat, Sep 18, 2021, 15:08 JING ZHANG wrote: > Hi Yuval, > You could open a JIRA to track this if you think some functions should be > added as built-in functions in Flink. > > Best, > JING ZHANG > > Yuval Itzch

Re: Built-in functions to manipulate MULTISET type

2021-09-18 Thread JING ZHANG
Hi Yuval, You could open a JIRA to track this if you think some functions should be added as built-in functions in Flink. Best, JING ZHANG Yuval Itzchakov 于2021年9月18日周六 下午3:33写道: > The problem with defining a UDF is that you have to create one overload > per key type in the MULTISET. It would b

Re: Built-in functions to manipulate MULTISET type

2021-09-18 Thread Yuval Itzchakov
The problem with defining a UDF is that you have to create one overload per key type in the MULTISET. It would be very convenient to have functions like Snowflakes ARRAY_AGG. On Sat, Sep 18, 2021, 05:43 JING ZHANG wrote: > Hi Kai, > AFAIK, there is no built-in function to extract the keys in MUL

Re: Built-in functions to manipulate MULTISET type

2021-09-17 Thread JING ZHANG
Hi Kai, AFAIK, there is no built-in function to extract the keys in MULTISET to be an ARRAY. Define a UTF is a good solution. Best, JING ZHANG Kai Fu 于2021年9月18日周六 上午7:35写道: > Hi team, > > We want to know if th