020-11-03 16:53:29.184 [pool-5-thread-1] ERROR c.a.o.canal.adapter.launcher.loader.CanalAdapterWorker - java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.sql.Timestamp java.lang.RuntimeException: java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.sql.Timestamp at com.alibaba.otter.canal.client.adapter.es.service.ESSyncService.sync(ESSyncService.java:110) at com.alibaba.otter.canal.client.adapter.es.service.ESSyncService.sync(ESSyncService.java:58) at com.alibaba.otter.canal.client.adapter.es.ESAdapter.sync(ESAdapter.java:169) at com.alibaba.otter.canal.client.adapter.es.ESAdapter.sync(ESAdapter.java:148) at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.batchSync(AbstractCanalAdapterWorker.java:201) at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$1(AbstractCanalAdapterWorker.java:62) at java.util.ArrayList.forEach(ArrayList.java:1257) at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$2(AbstractCanalAdapterWorker.java:58) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
6条答案
按热度按时间dfuffjeb1#
报错堆栈可以发一下么?
rks48beu2#
020-11-03 16:53:29.184 [pool-5-thread-1] ERROR c.a.o.canal.adapter.launcher.loader.CanalAdapterWorker - java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.sql.Timestamp
java.lang.RuntimeException: java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.sql.Timestamp
at com.alibaba.otter.canal.client.adapter.es.service.ESSyncService.sync(ESSyncService.java:110)
at com.alibaba.otter.canal.client.adapter.es.service.ESSyncService.sync(ESSyncService.java:58)
at com.alibaba.otter.canal.client.adapter.es.ESAdapter.sync(ESAdapter.java:169)
at com.alibaba.otter.canal.client.adapter.es.ESAdapter.sync(ESAdapter.java:148)
at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.batchSync(AbstractCanalAdapterWorker.java:201)
at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$1(AbstractCanalAdapterWorker.java:62)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at com.alibaba.otter.canal.adapter.launcher.loader.AbstractCanalAdapterWorker.lambda$null$2(AbstractCanalAdapterWorker.java:58)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
x6h2sr283#
我也遇到了这个问题,最后跟踪了一下源码发现:是ES的index没有这个字段,然后canal-adapter还是放到了esFieldData当中,导致传递给ES的时候,ES不支持Timestamp类型的转换操作,所以报错!
omqzjyyz4#
怎么解决的?
9gm1akwq5#
请问这个问题有解决么
k2fxgqgv6#
感觉这算是一个小问题,因为同等配置下,增量可以正常同步至es,但是etl失败, 具体原因 liuxuzxx说了一种,还有一种是类型不匹配。 这里说下我的解决过程。 增量同步时,adapter会自动检测es是否存在索引,如果不存在,则会自动创建,依据列值自动适配类型,但是类似时间这种复杂类型,会适配为 text。 增量导入后,进行etl导入,这时候会提示上述异常, 删除索引,重建索引(将类型一一Map正确),重启adapter(不重启依然报错,重启后才能恢复。。。)