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

Method into_array

datafusion/expr-common/src/columnar_value.rs:136–141  ·  view source on GitHub ↗

Convert any [`Self::Scalar`] into an Arrow [`ArrayRef`] with the specified number of rows by repeating the same scalar multiple times, which is not as efficient as handling the scalar directly. [`Self::Array`] will just be returned as is. See [`Self::into_array_of_size`] if you need to validate the length of the output array. See [`Self::values_to_arrays`] to convert multiple columnar values in

(self, num_rows: usize)

Source from the content-addressed store, hash-verified

134 ///
135 /// Errors if `self` is a Scalar that fails to be converted into an array of size
136 pub fn into_array(self, num_rows: usize) -> Result<ArrayRef> {
137 Ok(match self {
138 ColumnarValue::Array(array) => array,
139 ColumnarValue::Scalar(scalar) => scalar.to_array_of_size(num_rows)?,
140 })
141 }
142
143 /// Convert a columnar value into an Arrow [`ArrayRef`] with the specified
144 /// number of rows. [`Self::Scalar`] is converted by repeating the same

Callers 15

invoke_with_argsMethod · 0.45
run_any_matchFunction · 0.45
run_any_match_divFunction · 0.45
invoke_and_assertFunction · 0.45
invoke_with_argsMethod · 0.45
eval_hof_on_i32_listFunction · 0.45

Calls 1

to_array_of_sizeMethod · 0.45