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


##########
arrow-cast/src/cast/string.rs:
##########
@@ -38,6 +38,22 @@ pub(crate) fn value_to_string<O: OffsetSizeTrait>(
     Ok(Arc::new(builder.finish()))
 }
 
+pub(crate) fn value_to_string_view(
+    array: &dyn Array,
+    options: &CastOptions,
+) -> Result<ArrayRef, ArrowError> {
+    let mut builder = StringViewBuilder::with_capacity(array.len());
+    let formatter = ArrayFormatter::try_new(array, &options.format_options)?;
+    let nulls = array.nulls();
+    for i in 0..array.len() {
+        match nulls.map(|x| x.is_null(i)).unwrap_or_default() {
+            true => builder.append_null(),
+            false => formatter.value(i).write(&mut builder)?,
+        }
+    }
+    Ok(Arc::new(builder.finish()))
+}

Review Comment:
   I am trying to work down my review queue / reduce the number of things I am 
trying to keep track of and we have also gone around too much with this PR on 
you @tlm365  -- for that I apoloigize
   
   Here is a PR hopefully that will solve 
https://github.com/apache/arrow-rs/issues/6714:
   - https://github.com/apache/arrow-rs/pull/6816
   



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