liukun4515 commented on code in PR #1922:
URL: https://github.com/apache/arrow-rs/pull/1922#discussion_r904472049


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -72,9 +72,9 @@ pub fn can_cast_types(from_type: &DataType, to_type: 
&DataType) -> bool {
         // cast one decimal type to another decimal type
         (Decimal(_, _), Decimal(_, _)) => true,
         // signed numeric to decimal
-        (Int8 | Int16 | Int32 | Int64 | Float32 | Float64, Decimal(_, _)) |
+        (Null|Int8 | Int16 | Int32 | Int64 | Float32 | Float64, Decimal(_, _)) 
|
         // decimal to signed numeric
-        (Decimal(_, _), Int8 | Int16 | Int32 | Int64 | Float32 | Float64)
+        (Decimal(_, _), Null| Int8 | Int16 | Int32 | Int64 | Float32 | Float64)

Review Comment:
   From this comment 
https://github.com/apache/arrow-datafusion/issues/2759#issuecomment-1163865423, 
I compare the decimal with Null data type or null value of boolean data type in 
the spark, we can get that in the spark the null of boolean data type is not 
compatible with decimal data type, and the null of Null data type is compatible 
with decimal data type.



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