You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by zi...@apache.org on 2022/11/16 03:26:02 UTC

[inlong] branch branch-1.4 updated: [INLONG-6552][Sort] Fix MicroTimestamp error in oracle connector (#6554)

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

zirui pushed a commit to branch branch-1.4
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/branch-1.4 by this push:
     new 543a4b7df [INLONG-6552][Sort] Fix MicroTimestamp error in oracle connector (#6554)
543a4b7df is described below

commit 543a4b7df5959b4fcd1be9d4e7220d6caa056ca5
Author: emhui <11...@users.noreply.github.com>
AuthorDate: Wed Nov 16 10:12:26 2022 +0800

    [INLONG-6552][Sort] Fix MicroTimestamp error in oracle connector (#6554)
---
 .../cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/inlong-sort/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java b/inlong-sort/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java
index 530b96d6d..2569d4154 100644
--- a/inlong-sort/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java
+++ b/inlong-sort/sort-connectors/oracle-cdc/src/main/java/org/apache/inlong/sort/cdc/oracle/debezium/table/RowDataDebeziumDeserializeSchema.java
@@ -773,6 +773,9 @@ public final class RowDataDebeziumDeserializeSchema
         } else if (Timestamp.SCHEMA_NAME.equals(schemaName)) {
             Instant instantTime = Instant.ofEpochMilli((Long) fieldValue);
             fieldValue = LocalDateTime.ofInstant(instantTime, ZONE_UTC).toString();
+        } else if (MicroTimestamp.SCHEMA_NAME.equals(schemaName)) {
+            Instant instantTime = Instant.ofEpochMilli((Long) fieldValue / 1000);
+            fieldValue = LocalDateTime.ofInstant(instantTime, ZONE_UTC).toString();
         }
         return fieldValue;
     }