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


##########
arrow/src/compute/kernels/cast.rs:
##########
@@ -4312,6 +4314,24 @@ mod tests {
         assert_eq!(array_to_strings(&cast_array), expected);
     }
 
+    #[test]
+    fn test_cast_null_array_to_decimal_array() {
+        let data_type = DataType::Decimal(12, 4);
+        let array = new_null_array(&DataType::Null, 4);
+        assert_eq!(array.data_type(), &DataType::Null);
+        let cast_array = cast(&array, &data_type).expect("cast failed");
+        assert_eq!(cast_array.data_type(), &data_type);
+        for i in 0..4 {
+            assert!(cast_array.is_null(i));
+        }
+
+        // Now: can't convert decimal to NULL type
+        let array = new_null_array(&data_type, 4);

Review Comment:
   Why not support casting `Decimal` to `Null`? If we don't add support in this 
PR can / should file a ticket to add it in a follow on I think



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