shyiko / mysql-binlog-connector-java

MySQL Binary Log connector
2.2k stars 803 forks source link

JSON binary document is larger than json document for jsonarray parse for JSON_ARRAY sql update statement #328

Open GomesNayagam opened 4 years ago

GomesNayagam commented 4 years ago

I got the error when i use kafka connect io debizium for mysql. the sql statement i guess ran is below

sample sql:

UPDATE tesla.tasks SET Configuration = JSON_ARRAY_APPEND(Configuration, '$.jobCodes', "00LS7513") WHERE task_id=3

44-2d52-11e8-8e14-0050569a3d92:1-1513750463,81604171-2e5e-11e8-b151-0050569a18e0:1-2 (sid:9000003, cid:53244735) ata value for 'security.securitygroup.Configuration' of type JSON for row [[66, 82, 95, 83, 86, 67, 95, 65, 68, 86, 73, 83, 79, 82], [66, 111, 100, 121, 32, 82, parse and read a JSON value on Configuration JSON NOT NULL: The offset for the value in the JSON binary document is 14092, which is larger than the binary form lambda$convertJson$17(MySqlValueConverters.java:358) (JdbcValueConverters.java:1204) convertJson(MySqlValueConverters.java:346) lambda$converter$1(MySqlValueConverters.java:224) createValueGenerator$2(TableSchemaBuilder.java:256) nData(TableSchema.java:143) (RecordMakers.java:269) orTable.update(RecordMakers.java:499) date(BinlogReader.java:899) ent(BinlogReader.java:507) tifyEventListeners(BinaryLogClient.java:1095) stenForEventPackets(BinaryLogClient.java:943) nnect(BinaryLogClient.java:580) run(BinaryLogClient.java:825)

the JSON binary document is 14092, which is larger than the binary form of the JSON document (11788 bytes) ion.json.JsonBinary.parseArray(JsonBinary.java:503) ion.json.JsonBinary.parse(JsonBinary.java:217) ion.json.JsonBinary.parseObject(JsonBinary.java:400) ion.json.JsonBinary.parse(JsonBinary.java:211) ion.json.JsonBinary.parse(JsonBinary.java:205) ion.json.JsonBinary.parse(JsonBinary.java:181) ion.json.JsonBinary.parseAsString(JsonBinary.java:168) lambda$convertJson$17(MySqlValueConverters.java:356)

ng. Last offset stored = null, binlog reader near position = mysql-bin.001699/243807331 (io.debezium.connector.mysql.BinlogReader) rocessing binlog event (io.debezium.connector.mysql.BinlogReader) lue: null used for required field: "Configuration", schema type: STRING

osheroff commented 4 years ago

you may want to re-open this issue here:

https://github.com/osheroff/mysql-binlog-connector-java

and I'm not sure if the debezium folks have ported over to my fork, but I think I fixed these issues over there. (i'm presuming you're running mysql >= 8.0.something)