-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
add other timezone for the timestamp array for test
fn test_cast_timestamp_to_date32() {
let array =
TimestampMillisecondArray::from(vec![Some(864000000005), Some(1545696000001), None])
.with_timezone("UTC".to_string());
let b = cast(&array, &DataType::Date32).unwrap();
let c = b.as_primitive::<Date32Type>();
assert_eq!(10000, c.value(0));
assert_eq!(17890, c.value(1));
assert!(c.is_null(2));
// cast the timestamp using the different timezone to the date32
let array =
TimestampMillisecondArray::from(vec![Some(25201000), Some(111599000), None])
.with_timezone("-07:00".to_string());
let b = cast(&array, &DataType::Date32).unwrap();
let c = b.as_primitive::<Date32Type>();
println!("{:?}", array);
println!("{:?}", c);
}
And will get the result
PrimitiveArray<Timestamp(Millisecond, Some("-07:00"))>
[
1970-01-01T00:00:01-07:00,
**1970-01-01T23:59:59-07:00,**
null,
]
PrimitiveArray<Date32>
[
1970-01-01,
**1970-01-02,**
null,
]
The result is confused
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working