File tree 2 files changed +7
-2
lines changed
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ impl<W: VortexWrite> LayoutWriter<W> {
117
117
118
118
async fn write_metadata_arrays ( & mut self ) -> VortexResult < NestedLayout > {
119
119
let mut column_layouts = VecDeque :: with_capacity ( self . column_chunks . len ( ) ) ;
120
-
121
120
for mut chunk in mem:: take ( & mut self . column_chunks ) {
122
121
let len = chunk. byte_offsets . len ( ) - 1 ;
123
122
let mut chunks: VecDeque < Layout > = chunk
Original file line number Diff line number Diff line change @@ -148,10 +148,16 @@ impl<'a> WriteFlatBuffer for IPCArray<'a> {
148
148
) ,
149
149
} ;
150
150
151
+ // Assign buffer indices for all child arrays.
152
+ // The second tuple element holds the buffer_index for this Array subtree. If this array
153
+ // has a buffer, that is its buffer index. If it does not, that buffer index belongs
154
+ // to one of the children.
155
+ let child_buffer_offset = self . 1 + if self . 0 . buffer ( ) . is_some ( ) { 1 } else { 0 } ;
156
+
151
157
let children = column_data
152
158
. children ( )
153
159
. iter ( )
154
- . scan ( self . 1 , |buffer_offset, child| {
160
+ . scan ( child_buffer_offset , |buffer_offset, child| {
155
161
// Update the number of buffers required.
156
162
let msg = IPCArray ( child, * buffer_offset) . write_flatbuffer ( fbb) ;
157
163
* buffer_offset += child. cumulative_nbuffers ( ) ;
You can’t perform that action at this time.
0 commit comments