liukun4515 commented on issue #2387:
URL: https://github.com/apache/arrow-rs/issues/2387#issuecomment-1225169192

   I find other thing about the `casting`.
   I writ the test code for `cast int32 to int8` like below
   
   ```
           let a = Int32Array::from(vec![10000, 17890]);
           let array = Arc::new(a) as ArrayRef;
           let b = cast(&array, &DataType::Int8).unwrap();
           let c = b.as_any().downcast_ref::<Int8Array>().unwrap();
           println!("{:?}", c);
   ```
   All data are out of the range int8, we will get  `[NULL,NULL]`
   
   But for decimal data type conversion, we will get `Error`.
   
   I think the two results are not inconsistent. 
   Which is the right behavior for the `cast` when occurs overflow? @alamb  
@tustvold 


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