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


##########
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:
   In the type system, if we want to compare two types, we should get the 
coerced or common data type and convert them to the same common data type.
   I think the type of IN32 can't be compared with the type of Null, we should 
cast the Null type to the INT32 data type, but I think cast INT32 data type to 
Null Type is not right.



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to