File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ use serde_json::{json, Value};
3131use  std:: collections:: HashMap ; 
3232use  std:: pin:: Pin ; 
3333use  std:: sync:: Arc ; 
34+ use  std:: thread; 
3435use  std:: time:: Instant ; 
3536use  tracing:: error; 
3637
@@ -154,10 +155,13 @@ async fn execute_query(
154155    query :  LogicalQuery , 
155156    stream_name :  String , 
156157)  -> Result < ( Vec < RecordBatch > ,  Vec < String > ) ,  QueryError >  { 
157-     match  tokio:: task:: spawn_blocking ( move  || query. execute ( stream_name) ) . await  { 
158-         Ok ( Ok ( result) )  => Ok ( result) , 
159-         Ok ( Err ( e) )  => Err ( QueryError :: Execute ( e) ) , 
160-         Err ( e)  => Err ( QueryError :: Anyhow ( anyhow:: Error :: msg ( e. to_string ( ) ) ) ) , 
158+     let  handle = thread:: spawn ( move  || query. execute ( stream_name) ) ; 
159+     match  handle. join ( )  { 
160+         Ok ( result)  => match  result { 
161+             Ok ( r)  => Ok ( r) , 
162+             Err ( e)  => Err ( QueryError :: Execute ( e) ) , 
163+         } , 
164+         Err ( _)  => Err ( QueryError :: Anyhow ( anyhow:: Error :: msg ( "unable to join" ) ) ) , 
161165    } 
162166} 
163167
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments