nevi-me commented on a change in pull request #9291:
URL: https://github.com/apache/arrow/pull/9291#discussion_r567897431



##########
File path: rust/arrow/src/compute/kernels/cast.rs
##########
@@ -569,29 +569,27 @@ pub fn cast(array: &ArrayRef, to_type: &DataType) -> 
Result<ArrayRef> {
         (Time64(_), Int64) => cast_array_data::<Int64Type>(array, 
to_type.clone()),
         (Date32(DateUnit::Day), Date64(DateUnit::Millisecond)) => {
             let date_array = 
array.as_any().downcast_ref::<Date32Array>().unwrap();
-            let mut b = Date64Builder::new(array.len());
-            for i in 0..array.len() {
-                if array.is_null(i) {
-                    b.append_null()?;
-                } else {
-                    b.append_value(date_array.value(i) as i64 * 
MILLISECONDS_IN_DAY)?;
-                }
-            }
 
-            Ok(Arc::new(b.finish()) as ArrayRef)
+            // todo: can be optimized by computing this for the whole values 
buffer and

Review comment:
       we can open a JIRA to track this. I think 'unary' can also work (or was 
this before the cast improvement?)




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to