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


##########
arrow-cast/src/cast/mod.rs:
##########
@@ -1751,6 +1752,12 @@ pub fn cast_with_options(
             cast_with_options(&array, to_type, cast_options)
         }
 
+        // reinterpret Int64 without going through slice

Review Comment:
   rather than new special cases, how about updating the generic "same type" 
path from
   
   ```rust
   // clone array if types are the same
   if from_type == to_type {
       return Ok(make_array(array.to_data()));
   }
   ```
   
   to use the slice trick?
   
   ```rust
   // clone array if types are the same
   if from_type == to_type {
           return Ok(array.slice(0, array.len()));
   }
   ```



##########
arrow-cast/src/cast/mod.rs:
##########
@@ -630,7 +630,8 @@ pub fn cast_with_options(
     let from_type = array.data_type();
     // clone array if types are the same
     if from_type == to_type {
-        return Ok(make_array(array.to_data()));
+        // TODO: Array::as_arc? 
https://github.com/apache/arrow-rs/issues/8794#issuecomment-3563886963

Review Comment:
   that would be nice 🤔 



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