File tree Expand file tree Collapse file tree
vortex-layout/src/layouts/list Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2202,6 +2202,7 @@ mod tests {
22022202 #[ case:: two_cuts( & [ 1 , 3 ] , false , false ) ]
22032203 #[ case:: null_and_empty_at_cuts( & [ 1 , 3 ] , true , false ) ]
22042204 #[ case:: list_view_chunks( & [ 1 , 3 ] , true , true ) ]
2205+ #[ case:: non_nullable_list_view_chunks( & [ 1 , 3 ] , false , true ) ]
22052206 #[ tokio:: test]
22062207 async fn sliced_list_chunks_round_trip (
22072208 #[ case] cuts : & [ usize ] ,
Original file line number Diff line number Diff line change @@ -295,15 +295,16 @@ fn canonicalize_to_list_parts(
295295 exec_ctx : & mut ExecutionCtx ,
296296) -> VortexResult < ListDataParts > {
297297 let canonical = array. execute_until :: < AnyList > ( exec_ctx) ?;
298- if let Some ( list) = canonical. as_opt :: < List > ( ) {
299- // A sliced list keeps its parent's whole `elements`, but `global_offsets` assumes each
300- // chunk's offsets span exactly `[0, elements.len()]`.
301- Ok ( list. reset_offsets ( false , exec_ctx) ?. into_data_parts ( ) )
298+ let list = if let Some ( list) = canonical. as_opt :: < List > ( ) {
299+ list. into_owned ( )
302300 } else if let Some ( view) = canonical. as_opt :: < ListView > ( ) {
303- Ok ( list_from_list_view ( view. into_owned ( ) , exec_ctx) ?. into_data_parts ( ) )
301+ list_from_list_view ( view. into_owned ( ) , exec_ctx) ?
304302 } else {
305303 unreachable ! ( "AnyList matcher guarantees List or ListView" )
306- }
304+ } ;
305+ // Sliced lists can retain unused elements, and rebuilding a list view can leave a lazy
306+ // elements slice. Normalize both before passing their children to serializing strategies.
307+ Ok ( list. reset_offsets ( false , exec_ctx) ?. into_data_parts ( ) )
307308}
308309
309310/// Rebase a chunk's local `offsets` into global `u64` positions for the whole-column `offsets`
You can’t perform that action at this time.
0 commit comments