From 7250fc3bd4309be82b7e6d2cf855ab5be9760c52 Mon Sep 17 00:00:00 2001 From: yangjf2019 Date: Thu, 16 Jan 2025 15:49:16 +0800 Subject: [PATCH] [hotfix] Modify the type conversion method --- .../flink/action/cdc/postgres/PostgresRecordParser.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/postgres/PostgresRecordParser.java b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/postgres/PostgresRecordParser.java index 55c3538419c0..07156823b367 100644 --- a/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/postgres/PostgresRecordParser.java +++ b/paimon-flink/paimon-flink-cdc/src/main/java/org/apache/paimon/flink/action/cdc/postgres/PostgresRecordParser.java @@ -191,7 +191,7 @@ private DataType extractFieldType(DebeziumEvent.Field field) { if (StringUtils.isNullOrWhitespaceOnly(stringifyLength)) { return DataTypes.BOOLEAN(); } - Integer length = Integer.valueOf(stringifyLength); + int length = Integer.parseInt(stringifyLength); if (length == 1) { return DataTypes.BOOLEAN(); } else { @@ -295,7 +295,6 @@ else if (Date.SCHEMA_NAME.equals(className)) { newValue = DateTimeUtils.toLocalDate(Integer.parseInt(oldValue)).toString(); } else if (Timestamp.SCHEMA_NAME.equals(className)) { // timestamp (precision 0-3) - LocalDateTime localDateTime = DateTimeUtils.toLocalDateTime(Long.parseLong(oldValue), ZoneOffset.UTC); newValue = DateTimeUtils.formatLocalDateTime(localDateTime, 3); @@ -314,7 +313,6 @@ else if (Date.SCHEMA_NAME.equals(className)) { newValue = DateTimeUtils.formatLocalDateTime(localDateTime, 6); } else if (ZonedTimestamp.SCHEMA_NAME.equals(className)) { // timestamptz - LocalDateTime localDateTime = Instant.parse(oldValue).atZone(serverTimeZone).toLocalDateTime(); newValue = DateTimeUtils.formatLocalDateTime(localDateTime, 6);