From d03d753a2489731a2d9c6d8429ed72f4543aef19 Mon Sep 17 00:00:00 2001 From: gaoliang Date: Thu, 21 Sep 2023 15:23:39 +0800 Subject: [PATCH] [hotfix-#1823][connector][oracle] oracle Connector incorrectly consumed date-type data --- .../oracle/converter/OracleSqlConverter.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chunjun-connectors/chunjun-connector-oracle/src/main/java/com/dtstack/chunjun/connector/oracle/converter/OracleSqlConverter.java b/chunjun-connectors/chunjun-connector-oracle/src/main/java/com/dtstack/chunjun/connector/oracle/converter/OracleSqlConverter.java index 6d1748e6a2..a240235631 100644 --- a/chunjun-connectors/chunjun-connector-oracle/src/main/java/com/dtstack/chunjun/connector/oracle/converter/OracleSqlConverter.java +++ b/chunjun-connectors/chunjun-connector-oracle/src/main/java/com/dtstack/chunjun/connector/oracle/converter/OracleSqlConverter.java @@ -124,7 +124,17 @@ protected IDeserializationConverter createInternalConverter(LogicalType type) { new BigDecimal((BigInteger) val, 0), precision, scale) : DecimalData.fromBigDecimal((BigDecimal) val, precision, scale); case DATE: - return val -> Long.valueOf(((Timestamp) val).getTime() / 1000).intValue(); + return val -> + val instanceof Timestamp + ? (int) + (((Timestamp) val) + .toLocalDateTime() + .toLocalDate() + .toEpochDay()) + : (int) + ((Date.valueOf(String.valueOf(val))) + .toLocalDate() + .toEpochDay()); case TIME_WITHOUT_TIME_ZONE: return val -> (int)