alibaba / druid

阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
https://github.com/alibaba/druid/wiki
Apache License 2.0
27.76k stars 8.55k forks source link

fix: 修复通过maxwell进行数据同步时, RowMap中对象为BigInteger时提示UnsupportedOperationE… #6009

Closed AdolphLv closed 5 days ago

AdolphLv commented 6 days ago

修复通过maxwell进行数据同步时, RowMap中对象为BigInteger时提示UnsupportedOperationException问题

MySqlInsertStatement stmt = new MySqlInsertStatement(); stmt.setTableName(new SQLIdentifierExpr(r.getTable())); SQLInsertStatement.ValuesClause valuesClause = new SQLInsertStatement.ValuesClause(); stmt.addValueCause(valuesClause); LinkedHashMap<String, Object> data = r.getData(); for (String k : data.keySet()) { // v可能是BigInteger Object v = data.get(k); stmt.addColumn(new SQLIdentifierExpr(k)); valuesClause.addValue(v); }

CLAassistant commented 6 days ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: AdolphLv
:x: lyang


lyang seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

lizongbo commented 6 days ago

请签署确认一下 cla,还有这里的优化逻辑需要调整一下 BigDecimal类型的要使用 toPlainString,避免科学计数法,把BigInteger类似单独出来toStgring吧。