Hi all,
I'm trying to create a MapState<Integer, Tuple3<Set<String>, Set<String>, List<myClass>>> for KeyedBroadcastProcessFunction but I'm not sure how to initialize its MapStateDescriptor. I have written it in two ways as given below and my IDE isn't showing an error either way (haven't tested on runtime yet). I'd really appreciate if anyone can tell me which way is correct and if not what's the best way to give Type Hints for
Tuple3<Set<String>, Set<String>, List<myClass>>
myClass is POJO type. Code Snippet 1: private final MapStateDescriptor<Integer, Tuple3<Set<String>, Set<String>, List<myClass>>> outStateDesc = new MapStateDescriptor<>( "neighbours", BasicTypeInfo.INT_TYPE_INFO, new TupleTypeInfo<>(TypeInformation.of(new TypeHint<Set>() {}), TypeInformation.of(new TypeHint<Set>() {}), new ListTypeInfo<>(myClass.class))); Code Snippet 2: private final MapStateDescriptor<Integer, Tuple3<Set<String>, Set<String>, List<myClass>>> outStateDesc = new MapStateDescriptor<>( "neighbours", BasicTypeInfo.INT_TYPE_INFO, TypeInformation.of(new TypeHint<Tuple3<Set<String>, Set<String>, List<myClass>>>(){})); Best Regards, Komal |
Hi Komal: I think snippet 1 is better, because it carry more information like ListTypeInfo. Consider snippet 2, now our type inference in TypeInformation.of can not infer the nested information. (It not get the information: List<myClass>) On Fri, Nov 1, 2019 at 11:49 AM Jingsong Li <[hidden email]> wrote:
Best, Jingsong Lee |
Thank you. I went with the first one. Have not encountered any problems during run time. On Fri, 1 Nov 2019 at 12:50, Jingsong Lee <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |