zhuqi-lucas commented on issue #16193:
URL: https://github.com/apache/datafusion/issues/16193#issuecomment-2916070640

   > Just for context, I ran into this while working on a Java based 
application that drives the DataFusion queries. I want to be able to interrupt 
query execution from the Java side. From the Java side I'm basically calling 
`runtime.block_on(async { record_batch_stream.next().await })`. Since I can't 
use Java's thread interruption mechanism to unblock the `next()` call I was 
trying to use `tokio::select!` with a cancellation token instead and that 
failed to cancel. This is the same pattern as what the CLI does, just triggered 
via a different channel than a signal handler.
   > 
   > I still need to write an experiment for this, but based on my reading of 
the documentation even with a `RecordBatchReceiverStream` the aggregate would 
not actually get cancelled. It will look like it has cancelled because the top 
level task will yield, the `JoinSet` will get dropped, and the spawned tasks 
will be aborted. But tokio will only actually be able to terminate the task 
once the aggregate stream's poll loop yields.
   
   Thank you @pepijnve for this info, i tried the aggregate with more than 1 
partition, it seems can be canceled, and it uses RecordBatchReceiverStream 
inside the CoalescePartitionExec, do you mean it's not the 
RecordBatchReceiverStream which help the cancellation?


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to