-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Description
Describe the bug
While working on #7285 I noticed that some non-null values of Timestamp(TimeUnit::Microsecond)
print as null
.
To Reproduce
Running...
let arr: PrimitiveArray<TimestampMicrosecondType> =
TimestampMicrosecondArray::from(vec![9089380393200000000]);
println!("{:?}", arr);
...results in:
PrimitiveArray<Timestamp(Microsecond, None)>
[
null,
]
Expected behavior
This is a valid 64-bit microsecond timestamp that Spark says is [290000-12-30 15:00:00.0]
. I have not done the math to confirm that result yet, but it's definitely a a valid int64
so we should be able to print the resulting timestamp.
Additional context
I suspect the issue is that PrimitiveArray
's fmt
method coerces Timestamp
to the chrono crate's datetime
:
arrow-rs/arrow-array/src/array/primitive_array.rs
Line 1272 in 172d79f
DataType::Timestamp(_, tz_string_opt) => { |
which far enough down the call stack clips the values to 32-bit and generate a
null
.:
I also suspect that other TimeUnit
s are affected by this issue.