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

Method build

datafusion/common/src/scalar/struct_builder.rs:107–113  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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`]

Calls 2

newFunction · 0.85
StructClass · 0.50