File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ impl<W: io::Write> ColumnarBlockWriter<W> {
140140 /// `other` keeps building its incomplete block across calls; only its
141141 /// completed-block buffer and headers are drained.
142142 pub fn ingest_completed ( & mut self , other : & mut ColumnarBlockWriter < Vec < u8 > > ) -> Result < ( ) > {
143+ if other. headers . is_empty ( ) {
144+ return Ok ( ( ) ) ; // short-circuit
145+ }
146+
143147 // Write all completed blocks from the other
144148 self . inner . write_all ( other. inner_data ( ) ) ?;
145149
@@ -160,6 +164,10 @@ impl<W: io::Write> ColumnarBlockWriter<W> {
160164 ///
161165 /// [`ingest_completed`](Self::ingest_completed) should always be called first.
162166 fn ingest_incompleted ( & mut self , other : & mut ColumnarBlockWriter < Vec < u8 > > ) -> Result < ( ) > {
167+ if other. block . num_records == 0 {
168+ return Ok ( ( ) ) ; // short-circuit
169+ }
170+
163171 // Attempt to ingest the incomplete block from the other
164172 if !self . block . can_ingest ( & other. block ) {
165173 // Make space by flushing the current block
You can’t perform that action at this time.
0 commit comments