Skip to content

Commit

Permalink
[hotfix-#1823][connector][oracle] oracle Connector incorrectly consum…
Browse files Browse the repository at this point in the history
…ed date-type data (#1824)

Co-authored-by: gaoliang <gaoliang@360.cn>
  • Loading branch information
david-gao1 and gaoliang authored Sep 21, 2023
1 parent da35245 commit 49c6873
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49c6873

Please sign in to comment.