QuakeWang commented on code in PR #545:
URL: https://github.com/apache/paimon-rust/pull/545#discussion_r3611742869
##########
crates/paimon/src/arrow/format/row.rs:
##########
@@ -1777,11 +1777,27 @@ fn read_timestamp_value(input: &mut BlockInput<'_>,
unit: TimeUnit) -> crate::Re
TimeUnit::Millisecond => millis,
TimeUnit::Microsecond => {
let nanos = i64::from(input.read_var_u32()?);
- millis * 1_000 + nanos / 1_000
+ millis
+ .checked_mul(1_000)
Review Comment:
The separate `checked_mul` incorrectly rejects valid timestamps at the
negative boundary. The existing writer can encode `i64::MIN`, and the final
reconstructed value still fits in `i64`, but this returns `DataInvalid` before
adding the nanos component, making valid `.row` data produced by the writer
unreadable.
--
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]