Return a [`ScalarValue::Struct`] with the fields and values added so far # Errors If the [`StructArray`] cannot be created (for example if there is a mismatch between field types and arrays) or the arrays do not have exactly one element.
(self)
| 105 | /// mismatch between field types and arrays) or the arrays do not have |
| 106 | /// exactly one element. |
| 107 | pub fn build(self) -> Result<ScalarValue> { |
| 108 | let Self { fields, arrays } = self; |
| 109 | |
| 110 | let struct_array = |
| 111 | StructArray::try_new_with_length(Fields::from(fields), arrays, None, 1)?; |
| 112 | Ok(ScalarValue::Struct(Arc::new(struct_array))) |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | /// Trait for converting a type into a [`FieldRef`] |