You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Converting from Timestamp(Nanosecond, _) to Timestamp(Microsecond, _) doesn't actually return the correct value. It simply interchanges the inner integer.
To Reproduce
Running the following:
#[test]fntest_repro(){let new_scalar = try_cast_literal_to_type(&ScalarValue::TimestampNanosecond(Some(123456),None),&DataType::Timestamp(TimeUnit::Microsecond,None)).unwrap().unwrap();// This passes which is wrongassert_eq!(new_scalar,ScalarValue::TimestampMicrosecond(Some(123456),None));// This fails!// assert_eq!(new_scalar, ScalarValue::TimestampMicrosecond(Some(123), None));}
Expected behavior
// This should be the correct resultassert_eq!(new_scalar,ScalarValue::TimestampMicrosecond(Some(123),None));
Activity
comphead commentedon Mar 8, 2023
The sql repr works better.
Thanks @vrongmeal for reporting the bug.
Workaround DF timestamp precision issue