JNSimba commented on code in PR #586:
URL:
https://github.com/apache/doris-flink-connector/pull/586#discussion_r2052141548
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/serialization/RowBatch.java:
##########
@@ -582,9 +582,9 @@ public LocalDateTime getDateTime(int rowIndex, FieldVector
fieldVector) {
public static LocalDateTime longToLocalDateTime(long time) {
Instant instant;
// Determine the timestamp accuracy and process it
- if (time < 10_000_000_000L) { // Second timestamp
+ if (time > -10_000_000_000L && time < 10_000_000_000L) { // Second
timestamp
instant = Instant.ofEpochSecond(time);
- } else if (time < 10_000_000_000_000L) { // milli second
+ } else if (time > -10_000_000_000_000L && time < 10_000_000_000_000L)
{ // milli second
instant = Instant.ofEpochMilli(time);
} else { // micro second
instant = Instant.ofEpochSecond(time / 1_000_000, (time %
1_000_000) * 1_000);
Review Comment:
It is better to add a case to cover the lower boundary value
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]