MCPcopy Create free account
hub / github.com/apache/datafusion / new_large_list

Method new_large_list

datafusion/common/src/scalar/mod.rs:3291–3301  ·  view source on GitHub ↗

Converts `Vec ` where each element has type corresponding to `data_type`, to a [`LargeListArray`]. Example ``` use arrow::array::{Int32Array, LargeListArray}; use arrow::datatypes::{DataType, Int32Type}; use datafusion_common::cast::as_large_list_array; use datafusion_common::ScalarValue; let scalars = vec![ ScalarValue::Int32(Some(1)), ScalarValue::Int32(None), ScalarValue::Int32(So

(
        values: &[ScalarValue],
        data_type: &DataType,
    )

Source from the content-addressed store, hash-verified

3289 /// assert_eq!(*result, expected);
3290 /// ```
3291 pub fn new_large_list(
3292 values: &[ScalarValue],
3293 data_type: &DataType,
3294 ) -> Arc<LargeListArray> {
3295 let values = if values.is_empty() {
3296 new_empty_array(data_type)
3297 } else {
3298 Self::iter_to_array(values.iter().cloned()).unwrap()
3299 };
3300 Arc::new(SingleRowListArrayBuilder::new(values).build_large_list_array())
3301 }
3302
3303 /// Converts a scalar value into an array of `size` rows.
3304 ///

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
is_emptyMethod · 0.45
clonedMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected