Commit 5abbeaf0 authored by liaowenwu's avatar liaowenwu

防止null point

parent 9c53352a
...@@ -20,7 +20,7 @@ public class CanalMapToTsGroupFunction implements MapFunction<JSONObject, Tuple3 ...@@ -20,7 +20,7 @@ public class CanalMapToTsGroupFunction implements MapFunction<JSONObject, Tuple3
String table = value.getString("table"); String table = value.getString("table");
JSONArray pkNames = value.getJSONArray("pkNames"); JSONArray pkNames = value.getJSONArray("pkNames");
Set<String> pkNameSet = new HashSet<>(); Set<String> pkNameSet = new HashSet<>();
long ts = value.getLong("ts"); long ts = value.getLong("ts") == null ? System.currentTimeMillis() : value.getLong("ts");
if (CollUtil.isNotEmpty(pkNames)) { if (CollUtil.isNotEmpty(pkNames)) {
pkNames.forEach(name -> pkNameSet.add(String.valueOf(name))); pkNames.forEach(name -> pkNameSet.add(String.valueOf(name)));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment