yexianxun created FLINK-15443:
---------------------------------
Summary: Use JDBC connector write FLOAT value occur ClassCastException
Key: FLINK-15443
URL:
https://issues.apache.org/jira/browse/FLINK-15443 Project: Flink
Issue Type: Bug
Components: Connectors / JDBC
Affects Versions: 1.9.1
Environment: flink version is 1.9.1
Reporter: yexianxun
I defined a float type field in mysql table, when I use jdbc connector write float value into db, there are ClassCastException occurs.
{code:java}
//代码占位符
Caused by: java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Double, field index: 6, field value: 0.1.Caused by: java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Double, field index: 6, field value: 0.1. Caused by: java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Double, field index: 6, field value: 0.1.Caused by: java.lang.ClassCastException: java.lang.Float cannot be cast to java.lang.Double, field index: 6, field value: 0.1. at org.apache.flink.api.java.io.jdbc.JDBCUtils.setField(JDBCUtils.java:106) at org.apache.flink.api.java.io.jdbc.JDBCUtils.setRecordToStatement(JDBCUtils.java:63) at org.apache.flink.api.java.io.jdbc.writer.AppendOnlyWriter.addRecord(AppendOnlyWriter.java:56) at org.apache.flink.api.java.io.jdbc.JDBCUpsertOutputFormat.writeRecord(JDBCUpsertOutputFormat.java:144)
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)