`make_array_inner` is the implementation of the `make_array` function. Constructs an array using the input `data` as `ArrayRef`. Returns a reference-counted `Array` instance result.
(arrays: &[ArrayRef])
| 110 | /// Constructs an array using the input `data` as `ArrayRef`. |
| 111 | /// Returns a reference-counted `Array` instance result. |
| 112 | pub fn make_array_inner(arrays: &[ArrayRef]) -> Result<ArrayRef> { |
| 113 | let mut data_type = DataType::Null; |
| 114 | for arg in arrays { |
| 115 | let arg_data_type = arg.data_type(); |
| 116 | if !arg_data_type.equals_datatype(&DataType::Null) { |
| 117 | data_type = arg_data_type.clone(); |
| 118 | break; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | match data_type { |
| 123 | // Either an empty array or all nulls: |
| 124 | DataType::Null => { |
| 125 | let length = arrays.iter().map(|a| a.len()).sum(); |
| 126 | // By default Int32 |
| 127 | let array = new_null_array(&DataType::Null, length); |
| 128 | Ok(Arc::new( |
| 129 | SingleRowListArrayBuilder::new(array) |
| 130 | .with_nullable(true) |
| 131 | .with_field_name(Some(ARRAY_FIELD_DEFAULT_NAME.to_string())) |
| 132 | .build_list_array(), |
| 133 | )) |
| 134 | } |
| 135 | _ => array_array::<i32>(arrays, data_type, ARRAY_FIELD_DEFAULT_NAME), |
| 136 | } |
| 137 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…