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
  • Loading branch information
gaoliang committed Sep 21, 2023
1 parent 63297e9 commit d03d753
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 d03d753

Please sign in to comment.