liukun4515 opened a new issue, #9982:
URL: https://github.com/apache/arrow-datafusion/issues/9982

   ### 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 wil 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_


-- 
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]

Reply via email to