Jefffrey commented on code in PR #8739:
URL: https://github.com/apache/arrow-datafusion/pull/8739#discussion_r1441078856


##########
datafusion-cli/src/exec.rs:
##########
@@ -165,9 +166,15 @@ pub async fn exec_from_repl(
             }
             Ok(line) => {
                 rl.add_history_entry(line.trim_end())?;
-                match exec_and_print(ctx, print_options, line).await {
-                    Ok(_) => {}
-                    Err(err) => eprintln!("{err}"),
+                tokio::select! {
+                    res = exec_and_print(ctx, print_options, line) => match 
res {

Review Comment:
   I think this is correct, too
   
   Per [tokio::select 
documentation](https://docs.rs/tokio/latest/tokio/macro.select.html):
   
   > Waits on multiple concurrent branches, returning when the first branch 
completes, **cancelling the remaining branches.**
   
   This is also what I tried initially: 
https://github.com/apache/arrow-datafusion/issues/1279#issuecomment-1316660929
   
   But I had the roadblock of `exec_and_print` being blocking at that time. 
That doesn't seem to be the case anymore so this should be good.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to