jayzhan211 commented on code in PR #13623:
URL: https://github.com/apache/datafusion/pull/13623#discussion_r1866809443


##########
datafusion/common/src/utils/mod.rs:
##########
@@ -321,89 +321,180 @@ pub fn longest_consecutive_prefix<T: Borrow<usize>>(
     count
 }
 
+/// Creates single element [`ListArray`], [`LargeListArray`] and
+/// [`FixedSizeListArray`] from other arrays
+///
+/// For example this builder can convert `[1, 2, 3]` into `[[1, 2, 3]]`
+///
+/// # Example
+/// ```
+/// # use std::sync::Arc;
+/// # use arrow_array::{Array, ListArray};
+/// # use arrow_array::types::Int64Type;
+/// # use datafusion_common::utils::SingleRowArrayBuilder;
+/// // Array is [1, 2, 3]
+/// let arr = ListArray::from_iter_primitive::<Int64Type, _, _>(vec![
+///       Some(vec![Some(1), Some(2), Some(3)]),
+/// ]);
+/// // Wrap as a list array: [[1, 2, 3]]
+/// let list_arr = 
SingleRowArrayBuilder::new(Arc::new(arr)).build_list_array();
+/// assert_eq!(list_arr.len(), 1);
+/// ```
+#[derive(Debug, Clone)]
+pub struct SingleRowArrayBuilder {

Review Comment:
   It seems this builder is for List, maybe name with 
`SingleRowListArrayBuilder` is more concise?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to