Skip to content

Commit 6a8fac3

Browse files
committed
use try_new for struct array
Signed-off-by: Connor Tsui <[email protected]>
1 parent be23ca2 commit 6a8fac3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vortex-compute/src/arrow/struct_.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,18 @@ impl IntoArrow<ArrayRef> for StructVector {
1818
.map(|field| field.clone().into_arrow())
1919
.collect::<VortexResult<Vec<ArrayRef>>>()?;
2020

21-
// We need to make up the field names since vectors are unnamed.
21+
// We need to make up the field names since vectors are unnamed, so we just use the field
22+
// indices.
2223
let fields = Fields::from(
2324
(0..arrow_fields.len())
2425
.map(|i| Field::new(i.to_string(), arrow_fields[i].data_type().clone(), true))
2526
.collect::<Vec<Field>>(),
2627
);
2728

28-
Ok(Arc::new(StructArray::new(
29+
Ok(Arc::new(StructArray::try_new(
2930
fields,
3031
arrow_fields,
3132
validity.into_arrow()?,
32-
)))
33+
)?))
3334
}
3435
}

0 commit comments

Comments
 (0)