HuaHuaY opened a new issue, #48246:
URL: https://github.com/apache/arrow/issues/48246
### Describe the bug, including details regarding any error messages,
version, and platform.
Write a pre-1970 timestamp into parquet and then read it. Parquet will
return a different value. The reason is `ArrowTimestampToImpalaTimestamp` will
calculate a negative nanosecond value when passing a negative timestamp, but
`DecodeInt96Timestamp` will assume the nanosecond value is positive (it will
perform division on the numeric value).
```cpp
TEST(TestImpalaConversion, ArrowTimestampToImpalaTimestamp) {
{
// January 1, 1970 07:59:59 and 999999000 nanoseconds
int64_t timestamp = INT64_C(-1000);
Int96 impala_timestamp = {{UINT32_C(2437872664), UINT32_C(20116),
UINT32_C(2440587)}};
ASSERT_EQ(timestamp, ::parquet::Int96GetNanoSeconds(impala_timestamp));
Int96 calculated;
::parquet::internal::NanosecondsToImpalaTimestamp(timestamp,
&calculated);
ASSERT_EQ(impala_timestamp, calculated);
}
}
```
### Component(s)
C++, Parquet
--
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]