Hi Andres,

Just define a variable outside and modify it in the anonymous class.

Andres Angel <ingenieroandresan...@gmail.com> 于2019年7月24日周三 下午8:44写道:

> Hello everyone,
>
> I was wondering if there is a way how to read the content of a varible
> build within a map/flatmap function out of the DS method.
>
> example:
>
>  DataStream<String> dsString = env.fromElements("1,a,1.1|2,b,2.2,-2",
> "3,c|4,d,4.4");
>     DataStream<Object> dsTuple = dsString.flatMap(new
> FlatMapFunction<String, Object>() {
>         @Override
>         public void flatMap(String value, Collector<Object> out) throws
> Exception {
>             String var1 = "dummy";
>
>         }
>     });
>
>     System.out.print(var1);
>
> thanks so much
>

Reply via email to