Commit 0ef6a5f8 authored by liaowenwu's avatar liaowenwu

修改kafka连接

parent 181322a7
...@@ -152,7 +152,7 @@ public class MysqlDataTransferFunction extends ProcessFunction<JSONObject, Tuple ...@@ -152,7 +152,7 @@ public class MysqlDataTransferFunction extends ProcessFunction<JSONObject, Tuple
//需要处理成字符串加引号的类型 //需要处理成字符串加引号的类型
if(STR_SQL_TYPE.containsKey(upperCase)){ if(STR_SQL_TYPE.containsKey(upperCase)){
String step1 = StrUtil.replace(dataObj.getString(columnKey), "\\", "\\\\"); String step1 = StrUtil.replace(dataObj.getString(columnKey), "\\", "\\\\");
return StrUtil.replace(step1, "'", "\\'"); return "'" + StrUtil.replace(step1, "'", "\\'") + "'";
//return String.format("'%s'", dataObj.getString(columnKey).replace("\\","\\\\").replace("'", "\\'") ); //return String.format("'%s'", dataObj.getString(columnKey).replace("\\","\\\\").replace("'", "\\'") );
} }
...@@ -164,7 +164,7 @@ public class MysqlDataTransferFunction extends ProcessFunction<JSONObject, Tuple ...@@ -164,7 +164,7 @@ public class MysqlDataTransferFunction extends ProcessFunction<JSONObject, Tuple
} }
LocalDateTime dateTime = LocalDateTime.ofInstant(d.toInstant(), ZoneId.systemDefault()); LocalDateTime dateTime = LocalDateTime.ofInstant(d.toInstant(), ZoneId.systemDefault());
String date = "DATETIME".equals(upperCase) ? DATETIME_FORMAT.format(dateTime) : DATE_FORMAT.format(dateTime); String date = "DATETIME".equals(upperCase) ? DATETIME_FORMAT.format(dateTime) : DATE_FORMAT.format(dateTime);
return String.format("\"%s\"",date); return String.format("'%s'",date);
} }
return dataObj.getString(columnKey); return dataObj.getString(columnKey);
......
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