任务运行时异常:java.lang.IllegalStateException: assert 'decimal type not match' failed

问题描述/异常栈

2021-12-10 16:15:52
java.lang.IllegalStateException: assert 'decimal type not match' failed
    at com.ibm.icu.impl.Assert.assrt(Assert.java:23)
    at com.netease.sloth.flink.connector.kudu.table.KuduWriter.mapToOperation(KuduWriter.java:285)
    at com.netease.sloth.flink.connector.kudu.table.KuduWriter.write(KuduWriter.java:143)
    at com.netease.sloth.flink.connector.kudu.table.KuduTableSink$KuduSinkFunction.invoke(KuduTableSink.java:151)
    at com.netease.sloth.flink.connector.kudu.table.KuduTableSink$KuduSinkFunction.invoke(KuduTableSink.java:86)
    at org.apache.flink.table.runtime.operators.sink.SinkOperator.processElement(SinkOperator.java:72)
    at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:191)
    at org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.processElement(StreamTaskNetworkInput.java:204)
    at org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.emitNext(StreamTaskNetworkInput.java:174)
    at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:65)
    at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:398)
    at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:191)
    at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:619)
    at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:583)
    at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:758)
    at org.apache.flink.runtime.taskmanager.Task.run(Task.java:573)
    at java.lang.Thread.run(Thread.java:748)

解决方案

检查Sink与源端数据库字段类型,保证数据类型一致。

问题原因

Sink时字段类型与数据库中类型不匹配,类型转换异常。

作者:邓崃翔