Skip to content

Commit 848ce23

Browse files
IKAZUCHI-AkiraIKAZUCHI-Akira
authored andcommitted
[fix] fixed the issue of not handling negative values when process the accuracy range of timestamp
1 parent 2466b2b commit 848ce23

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,9 @@ public LocalDateTime getDateTime(int rowIndex, FieldVector fieldVector) {
582582
public static LocalDateTime longToLocalDateTime(long time) {
583583
Instant instant;
584584
// Determine the timestamp accuracy and process it
585-
if (time < 10_000_000_000L) { // Second timestamp
585+
if (time > -10_000_000_000L && time < 10_000_000_000L) { // Second timestamp
586586
instant = Instant.ofEpochSecond(time);
587-
} else if (time < 10_000_000_000_000L) { // milli second
587+
} else if (time > -10_000_000_000_000L && time < 10_000_000_000_000L) { // milli second
588588
instant = Instant.ofEpochMilli(time);
589589
} else { // micro second
590590
instant = Instant.ofEpochSecond(time / 1_000_000, (time % 1_000_000) * 1_000);

0 commit comments

Comments
 (0)