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::to_array_of_size`] if you need to validate the length of the output array. See [`Self::values_to_arrays`] to convert multiple columnar values into
(&self, num_rows: usize)
| 184 | /// |
| 185 | /// Errors if `self` is a Scalar that fails to be converted into an array of size |
| 186 | pub fn to_array(&self, num_rows: usize) -> Result<ArrayRef> { |
| 187 | Ok(match self { |
| 188 | ColumnarValue::Array(array) => Arc::clone(array), |
| 189 | ColumnarValue::Scalar(scalar) => scalar.to_array_of_size(num_rows)?, |
| 190 | }) |
| 191 | } |
| 192 | |
| 193 | /// Convert a columnar value into an Arrow [`ArrayRef`] with the specified |
| 194 | /// number of rows. [`Self::Scalar`] is converted by repeating the same |
no test coverage detected