File tree Expand file tree Collapse file tree
vortex-duckdb/src/exporter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23082,6 +23082,8 @@ impl vortex_array::Array<vortex_array::arrays::ListView>
2308223082
2308323083pub fn vortex_array::Array<vortex_array::arrays::ListView>::rebuild(&self, vortex_array::arrays::listview::ListViewRebuildMode) -> vortex_error::VortexResult<vortex_array::arrays::ListViewArray>
2308423084
23085+ pub fn vortex_array::Array<vortex_array::arrays::ListView>::should_rebuild(&self, bool) -> bool
23086+
2308523087impl vortex_array::Array<vortex_array::arrays::Masked>
2308623088
2308723089pub fn vortex_array::Array<vortex_array::arrays::Masked>::try_new(vortex_array::ArrayRef, vortex_array::validity::Validity) -> vortex_error::VortexResult<Self>
Original file line number Diff line number Diff line change @@ -389,7 +389,7 @@ impl ListViewArray {
389389 }
390390 }
391391
392- fn should_rebuild ( & self , exact : bool ) -> bool {
392+ pub fn should_rebuild ( & self , exact : bool ) -> bool {
393393 let density = if exact {
394394 self . compute_density ( )
395395 } else {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use vortex::array::ExecutionCtx;
1111use vortex:: array:: arrays:: ListViewArray ;
1212use vortex:: array:: arrays:: PrimitiveArray ;
1313use vortex:: array:: arrays:: listview:: ListViewDataParts ;
14+ use vortex:: array:: arrays:: listview:: ListViewRebuildMode ;
1415use vortex:: array:: match_each_integer_ptype;
1516use vortex:: array:: validity:: Validity ;
1617use vortex:: dtype:: IntegerPType ;
@@ -50,13 +51,20 @@ pub(crate) fn new_exporter(
5051 ctx : & mut ExecutionCtx ,
5152) -> VortexResult < Box < dyn ColumnExporter > > {
5253 let len = array. len ( ) ;
54+
55+ let compact_array = if array. should_rebuild ( false ) {
56+ array. rebuild ( ListViewRebuildMode :: MakeZeroCopyToList ) ?
57+ } else {
58+ array
59+ } ;
60+
5361 let ListViewDataParts {
5462 elements_dtype,
5563 elements,
5664 offsets,
5765 sizes,
5866 validity,
59- } = array . into_data_parts ( ) ;
67+ } = compact_array . into_data_parts ( ) ;
6068 // Cache an `elements` vector up front so that future exports can reference it.
6169 let num_elements = elements. len ( ) ;
6270
You can’t perform that action at this time.
0 commit comments