@@ -17,14 +17,12 @@ use vortex_error::VortexExpect;
1717use vortex_error:: VortexResult ;
1818use vortex_mask:: Mask ;
1919use vortex_proto:: expr as pb;
20+ use vortex_vector:: struct_:: StructVector ;
2021use vortex_vector:: Datum ;
2122use vortex_vector:: ScalarOps ;
2223use vortex_vector:: VectorMutOps ;
2324use vortex_vector:: VectorOps ;
24- use vortex_vector:: struct_:: StructVector ;
2525
26- use crate :: ArrayRef ;
27- use crate :: IntoArray ;
2826use crate :: arrays:: StructArray ;
2927use crate :: expr:: Arity ;
3028use crate :: expr:: ChildName ;
@@ -34,6 +32,8 @@ use crate::expr::Expression;
3432use crate :: expr:: VTable ;
3533use crate :: expr:: VTableExt ;
3634use crate :: validity:: Validity ;
35+ use crate :: ArrayRef ;
36+ use crate :: IntoArray ;
3737
3838/// Pack zero or more expressions into a structure with named fields.
3939pub struct Pack ;
@@ -157,7 +157,7 @@ impl VTable for Pack {
157157 . map ( |v| v. ensure_vector ( args. row_count ) )
158158 . collect ( ) ;
159159 return Ok ( Datum :: Vector (
160- StructVector :: new ( Arc :: new ( fields) , Mask :: new_true ( args. row_count ) ) . into ( ) ,
160+ StructVector :: try_new ( Arc :: new ( fields) , Mask :: new_true ( args. row_count ) ) ? . into ( ) ,
161161 ) ) ;
162162 }
163163
@@ -219,22 +219,22 @@ pub fn pack(
219219mod tests {
220220 use vortex_buffer:: buffer;
221221 use vortex_dtype:: Nullability ;
222- use vortex_error:: VortexResult ;
223222 use vortex_error:: vortex_bail;
223+ use vortex_error:: VortexResult ;
224224
225+ use super :: pack;
225226 use super :: Pack ;
226227 use super :: PackOptions ;
227- use super :: pack;
228- use crate :: Array ;
229- use crate :: ArrayRef ;
230- use crate :: IntoArray ;
231- use crate :: ToCanonical ;
232228 use crate :: arrays:: PrimitiveArray ;
233229 use crate :: arrays:: StructArray ;
234- use crate :: expr:: VTableExt ;
235230 use crate :: expr:: exprs:: get_item:: col;
231+ use crate :: expr:: VTableExt ;
236232 use crate :: validity:: Validity ;
237233 use crate :: vtable:: ValidityHelper ;
234+ use crate :: Array ;
235+ use crate :: ArrayRef ;
236+ use crate :: IntoArray ;
237+ use crate :: ToCanonical ;
238238
239239 fn test_array ( ) -> ArrayRef {
240240 StructArray :: from_fields ( & [
0 commit comments