tlm365 commented on code in PR #6719:
URL: https://github.com/apache/arrow-rs/pull/6719#discussion_r1843196384


##########
arrow-cast/src/cast/mod.rs:
##########
@@ -1462,6 +1464,9 @@ pub fn cast_with_options(
         (BinaryView, _) => Err(ArrowError::CastError(format!(
             "Casting from {from_type:?} to {to_type:?} not supported",
         ))),
+        (from_type, Utf8View) if from_type.is_primitive() => {

Review Comment:
   After reviewing the code, I realized that the Timestamp -> Utf8View cast is 
not supported yet.
   
   The main issue comes from the current implementation of 
`formatter.format.write` 
([source](https://github.com/apache/arrow-rs/blob/1d580ec1996e75bb9be4c1c880871d0dd2718ad4/arrow-cast/src/display.rs#L175))
 which currently only applies to `DisplayIndex` derives 
([source](https://github.com/apache/arrow-rs/blob/1d580ec1996e75bb9be4c1c880871d0dd2718ad4/arrow-cast/src/display.rs#L255)),
 but the Temporal datatype is implemented based on `DisplayIndexState` 
([source](https://github.com/apache/arrow-rs/blob/1d580ec1996e75bb9be4c1c880871d0dd2718ad4/arrow-cast/src/display.rs#L530-L564)).
   
   I think this issue deserves a separate PR to handle the temporal -> string 
view casting.



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