fix mysql output bug(type of BigDecimal)
@@ -32,6 +32,7 @@ import org.apache.flink.table.sinks.RetractStreamTableSink;
import org.apache.flink.table.sinks.TableSink;
import org.apache.flink.types.Row;
+import java.math.BigDecimal;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.List;
@@ -119,6 +120,8 @@ public abstract class DBSink implements RetractStreamTableSink<Row> {
tmpFieldsType[i] = Types.DOUBLE;
}else if(fieldType.equals(Timestamp.class.getName())){
tmpFieldsType[i] = Types.TIMESTAMP;
+ }else if(fieldType.equals(BigDecimal.class.getName())){
+ tmpFieldsType[i] = Types.DECIMAL;
}else{
throw new RuntimeException("no support field type for sql. the input type:" + fieldType);
}
