File tree Expand file tree Collapse file tree
rust/lance-index/src/scalar/inverted Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,12 +159,20 @@ impl InvertedIndexBuilder {
159159 index_tasks. push ( task) ;
160160 }
161161
162- let mut stream = flatten_stream. map ( |batch| {
163- let batch = batch?;
164- let num_rows = batch. num_rows ( ) ;
165- sender. send_blocking ( batch) . expect ( "failed to send batch" ) ;
166- Result :: Ok ( num_rows)
167- } ) ;
162+ let sender = Arc :: new ( sender) ;
163+
164+ let mut stream = Box :: pin ( flatten_stream. then ( {
165+ |batch_result| {
166+ let sender = sender. clone ( ) ;
167+ async move {
168+ let sender = sender. clone ( ) ;
169+ let batch = batch_result?;
170+ let num_rows = batch. num_rows ( ) ;
171+ sender. send ( batch) . await . expect ( "failed to send batch" ) ;
172+ Result :: Ok ( num_rows)
173+ }
174+ }
175+ } ) ) ;
168176 log:: info!( "indexing FTS with {} workers" , num_workers) ;
169177
170178 let mut last_num_rows = 0 ;
You can’t perform that action at this time.
0 commit comments