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};
31
31
use std:: collections:: HashMap ;
32
32
use std:: pin:: Pin ;
33
33
use std:: sync:: Arc ;
34
+ use std:: thread;
34
35
use std:: time:: Instant ;
35
36
use tracing:: error;
36
37
@@ -154,10 +155,13 @@ async fn execute_query(
154
155
query : LogicalQuery ,
155
156
stream_name : String ,
156
157
) -> 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" ) ) ) ,
161
165
}
162
166
}
163
167
You can’t perform that action at this time.
0 commit comments