Solve MySQL Source JSON Invalid
This article provides solutions to resolve the issue of MySQL source JSON invalid writing.
Issue
MySQL source DataJob interrupted, and the log shows:
Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Invalid JSON text: The document root must not be followed by other values.
Cause
The issue is caused by unescaped special characters in the JSON field values, resulting in truncation of the JSON data.
Solution
- Go to the DataJob Details page. Click Function > Modify DataJob Params > Source tab.
- Modify the value of needJsonEscape to true.
- Click Save in the upper-right corner and confirm.