@@ -116,7 +116,11 @@ impl Processor for SequenceGroupProcessor {
116116 }
117117 } else if input. port . has_data ( ) {
118118 if self . ignore_output {
119- let _ignore = input. port . pull_data ( ) . unwrap ( ) ?;
119+ let _ignore = input. port . pull_data ( ) . ok_or_else ( || {
120+ databend_common_exception:: ErrorCode :: Internal (
121+ "Failed to pull data from input port when ignoring output" ,
122+ )
123+ } ) ??;
120124 input. status = PortStatus :: Idle ;
121125
122126 if input. port . is_finished ( ) {
@@ -135,7 +139,11 @@ impl Processor for SequenceGroupProcessor {
135139 }
136140
137141 while !self . waiting_outputs . is_empty ( ) && !self . waiting_inputs . is_empty ( ) {
138- let output_index = self . waiting_outputs . pop_front ( ) . unwrap ( ) ;
142+ let output_index = self . waiting_outputs . pop_front ( ) . ok_or_else ( || {
143+ databend_common_exception:: ErrorCode :: Internal (
144+ "Waiting outputs queue should not be empty" ,
145+ )
146+ } ) ?;
139147
140148 // Port is finished when waiting.
141149 if self . outputs [ output_index] . port . is_finished ( ) {
@@ -147,11 +155,18 @@ impl Processor for SequenceGroupProcessor {
147155 continue ;
148156 }
149157
150- let input_index = self . waiting_inputs . pop_front ( ) . unwrap ( ) ;
151-
152- self . outputs [ output_index]
153- . port
154- . push_data ( self . inputs [ input_index] . port . pull_data ( ) . unwrap ( ) ) ;
158+ let input_index = self . waiting_inputs . pop_front ( ) . ok_or_else ( || {
159+ databend_common_exception:: ErrorCode :: Internal (
160+ "Waiting inputs queue should not be empty" ,
161+ )
162+ } ) ?;
163+
164+ let data = self . inputs [ input_index] . port . pull_data ( ) . ok_or_else ( || {
165+ databend_common_exception:: ErrorCode :: Internal (
166+ "Failed to pull data from input port" ,
167+ )
168+ } ) ?;
169+ self . outputs [ output_index] . port . push_data ( data) ;
155170 self . inputs [ input_index] . status = PortStatus :: Idle ;
156171 self . outputs [ output_index] . status = PortStatus :: Idle ;
157172
0 commit comments