Skip to content

Commit 089868d

Browse files
committed
Merge remote-tracking branch 'origin/hotfix_1.8_3.10.x_30201' into temp_1.8_release_3.10.x_merge30201
# Conflicts: # flinkx-postgresql/flinkx-postgresql-writer/src/main/java/com/dtstack/flinkx/postgresql/format/PostgresqlOutputFormat.java
2 parents 9a8645b + c0d960f commit 089868d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flinkx-postgresql/flinkx-postgresql-core/src/main/java/com/dtstack/flinkx/postgresql/PostgresqlTypeConverter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.dtstack.flinkx.rdb.type.TypeConverterInterface;
2222
import org.apache.commons.lang3.StringUtils;
2323

24+
import java.math.BigDecimal;
2425
import java.util.Arrays;
2526
import java.util.Collections;
2627
import java.util.List;
@@ -65,6 +66,9 @@ public Object convert(Object data,String typeName) {
6566
}else if(byteTypes.contains(typeName)){
6667
data = Byte.valueOf(dataValue);
6768
} else if(intTypes.contains(typeName)){
69+
if(dataValue.contains(".")){
70+
dataValue = new BigDecimal(dataValue).stripTrailingZeros().toPlainString();
71+
}
6872
data = Integer.parseInt(dataValue);
6973
}
7074

0 commit comments

Comments
 (0)