Re:Re: map can't return null

2019-09-29 Thread a****
hi, ok,thanks.I'll read it. Then I have another problem, which was that I had caught the exception ,but it still came out. At 2019-09-29 17:05:20, "Biao Liu" wrote: Hi allan, It's not a bug. Flink does not support null value, see discussion [1]. In you example, you have to return

Re: map can't return null

2019-09-29 Thread Biao Liu
Hi allan, It's not a bug. Flink does not support null value, see discussion [1]. In you example, you have to return something with MapFunction even there is nothing to return. Maybe you could use flatmap instead of map to handle this null value scenario. It's allowed to collect nothing (skip

Re: map can't return null

2019-09-29 Thread Abhishek Jain
Hi Allan, Map does support null but tuple serializer does not. You might want to use pojo or row types if you need to deal with null values. Read more here . - Abhishek On Sun, 29

map can't return null

2019-09-29 Thread allan
Hi guys, When I use like the code, .map(new MapFunction>() { @Override public Tuple2 map(String value) throws Exception { if (properties != null) { return new Tuple2<>(cv_no, json.toJSONString()); } return null;