This is an automated email from the ASF dual-hosted git repository.

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 0df8b9d2ce [hotfix] Modify the type conversion method (#4928)
0df8b9d2ce is described below

commit 0df8b9d2ceed07cb27437d83a6d3a759f164a74c
Author: yangjf2019 <[email protected]>
AuthorDate: Thu Jan 16 16:45:44 2025 +0800

    [hotfix] Modify the type conversion method (#4928)
---
 .../apache/paimon/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 55c3538419..07156823b3 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 @@ public class PostgresRecordParser
                     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 @@ public class PostgresRecordParser
                 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 @@ public class PostgresRecordParser
                 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);

Reply via email to