Re: DataStream.keyBy() with keys determined at run time

2022-07-11 Thread Thomas Wang
Hemanga, the issue is that the number of keys is unknown at the compile time. I ended up using yidan's suggestion and serialized all keys into a string. Thanks for the suggestion. Thomas On Sun, Jul 10, 2022 at 7:05 PM yidan zhao wrote: > You can use string, and serialize all keys to a string.

Re: DataStream.keyBy() with keys determined at run time

2022-07-10 Thread yidan zhao
You can use string, and serialize all keys to a string. Hemanga Borah 于2022年7月11日周一 09:49写道: > > Here is the documentation of the Tuple class: > https://nightlies.apache.org/flink/flink-docs-master/api/java/org/apache/flink/api/java/tuple/Tuple.html > > If you need a concrete class, you can go f

Re: DataStream.keyBy() with keys determined at run time

2022-07-10 Thread Hemanga Borah
Here is the documentation of the Tuple class: https://nightlies.apache.org/flink/flink-docs-master/api/java/org/apache/flink/api/java/tuple/Tuple.html If you need a concrete class, you can go from Tuple0 to Tuple25. On Sun, Jul 10, 2022 at 5:43 PM Thomas Wang wrote: > I didn't copy the exact er

Re: DataStream.keyBy() with keys determined at run time

2022-07-10 Thread Thomas Wang
I didn't copy the exact error message, but basically the idea of the error message is that I cannot use the abstract class Tuple and instead, I should use Tuple1, Tuple2 and etc. Thomas On Sun, Jul 10, 2022 at 12:47 PM Hemanga Borah wrote: > What error do you see? > > On Sun, Jul 10, 2022 at 6:

Re: DataStream.keyBy() with keys determined at run time

2022-07-10 Thread Hemanga Borah
What error do you see? On Sun, Jul 10, 2022 at 6:30 AM Thomas Wang wrote: > Hi, > > I have a use case where I need to call DataStream.keyBy() with keys loaded > from a configuration. The number of keys and their data types are variables > and is determined by the configuration. Once the configur

DataStream.keyBy() with keys determined at run time

2022-07-10 Thread Thomas Wang
Hi, I have a use case where I need to call DataStream.keyBy() with keys loaded from a configuration. The number of keys and their data types are variables and is determined by the configuration. Once the configuration is loaded, they won't change. I'm trying to use the following key selector, but