22// SPDX-FileCopyrightText: Copyright the Vortex contributors
33
44use std:: collections:: BTreeSet ;
5- use std:: ops:: Not ;
65use std:: ops:: Range ;
76use std:: sync:: Arc ;
87
@@ -11,9 +10,8 @@ use itertools::Itertools;
1110use vortex_array:: ArrayRef ;
1211use vortex_array:: IntoArray ;
1312use vortex_array:: MaskFuture ;
14- use vortex_array:: ToCanonical ;
15- use vortex_array:: arrays:: MaskedArray ;
16- use vortex_array:: arrays:: StructArray ;
13+ use vortex_array:: arrays:: ScalarFnArray ;
14+ use vortex_array:: arrays:: ScalarFnVTable ;
1715use vortex_array:: builtins:: ArrayBuiltins ;
1816use vortex_array:: expr:: ExactExpr ;
1917use vortex_array:: expr:: Expression ;
@@ -26,8 +24,6 @@ use vortex_array::expr::transform::PartitionedExpr;
2624use vortex_array:: expr:: transform:: partition;
2725use vortex_array:: expr:: transform:: replace;
2826use vortex_array:: expr:: transform:: replace_root_fields;
29- use vortex_array:: validity:: Validity ;
30- use vortex_array:: vtable:: ValidityHelper ;
3127use vortex_dtype:: DType ;
3228use vortex_dtype:: FieldMask ;
3329use vortex_dtype:: FieldName ;
@@ -349,18 +345,17 @@ impl LayoutReader for StructReader {
349345
350346 // If root expression was a pack, then we apply the validity to each child field
351347 if is_pack_merge {
352- let struct_array = array. to_struct ( ) ;
353- let masked_fields : Vec < ArrayRef > = struct_array
354- . fields ( )
355- . iter ( )
348+ let array = array. as_ :: < ScalarFnVTable > ( ) ;
349+ let masked_children : Vec < ArrayRef > = array
350+ . children ( )
351+ . into_iter ( )
356352 . map ( |a| a. mask ( & validity) )
357353 . try_collect ( ) ?;
358354
359- Ok ( StructArray :: try_new (
360- struct_array. names ( ) . clone ( ) ,
361- masked_fields,
362- struct_array. len ( ) ,
363- struct_array. validity ( ) . clone ( ) ,
355+ Ok ( ScalarFnArray :: try_new (
356+ array. scalar_fn ( ) . clone ( ) ,
357+ masked_children,
358+ array. len ( ) ,
364359 ) ?
365360 . into_array ( ) )
366361 } else {
0 commit comments