Jefffrey commented on code in PR #9134:
URL: https://github.com/apache/arrow-rs/pull/9134#discussion_r2678421423


##########
arrow-data/src/data.rs:
##########
@@ -698,7 +698,29 @@ impl ArrayData {
                         false,
                     )
                 }
-                d => unreachable!("{d}"),
+                // Handled by Some(width) branch above
+                DataType::Int8
+                | DataType::Int16
+                | DataType::Int32
+                | DataType::Int64
+                | DataType::UInt8
+                | DataType::UInt16
+                | DataType::UInt32
+                | DataType::UInt64
+                | DataType::Float16
+                | DataType::Float32
+                | DataType::Float64
+                | DataType::Timestamp(_, _)
+                | DataType::Date32
+                | DataType::Date64
+                | DataType::Time32(_)
+                | DataType::Time64(_)
+                | DataType::Duration(_)
+                | DataType::Interval(_)
+                | DataType::Decimal32(_, _)
+                | DataType::Decimal64(_, _)
+                | DataType::Decimal128(_, _)

Review Comment:
   Same reasoning here, if we have a new type (that isn't primitive) we will 
know via compile error



##########
arrow-cast/src/cast/mod.rs:
##########
@@ -805,41 +771,7 @@ pub fn cast_with_options(
         return Ok(make_array(array.to_data()));
     }
     match (from_type, to_type) {
-        (
-            Null,
-            Boolean
-            | Int8
-            | UInt8
-            | Int16
-            | UInt16
-            | Float16
-            | Int32
-            | UInt32
-            | Float32
-            | Date32
-            | Time32(_)
-            | Int64
-            | UInt64
-            | Float64
-            | Date64
-            | Timestamp(_, _)
-            | Time64(_)
-            | Duration(_)
-            | Interval(_)
-            | FixedSizeBinary(_)
-            | Binary
-            | Utf8
-            | LargeBinary
-            | LargeUtf8
-            | BinaryView
-            | Utf8View
-            | List(_)
-            | LargeList(_)
-            | FixedSizeList(_, _)
-            | Struct(_)
-            | Map(_, _)
-            | Dictionary(_, _),
-        ) => Ok(new_null_array(to_type, array.len())),
+        (Null, _) => Ok(new_null_array(to_type, array.len())),

Review Comment:
   Decided to collapse them together as it was hard to tell if we were meant to 
enumerate all types or if certain types were meant to be omitted. This was if 
we support a new type it should automatically come in.



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