mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 16:50:48 +00:00
Fix pulling pipeline
This commit is contained in:
parent
cf75dd2595
commit
29dd2e56f9
@ -4051,7 +4051,7 @@ Possible values:
|
||||
Default value: `0`.
|
||||
|
||||
## stop_reading_on_first_cancel {#stop_reading_on_first_cancel}
|
||||
When set to true and the user wants to interrupt a query (for example using Ctrl+C on the client), then the query continues execution only on data that was already read from the table. Afterward, it will return a partial result of the query for the part of the table that was read. To fully stop the execution of a query without a partial result, the user should send 2 cancel requests.
|
||||
When set to `true` and the user wants to interrupt a query (for example using `Ctrl+C` on the client), then the query continues execution only on data that was already read from the table. Afterward, it will return a partial result of the query for the part of the table that was read. To fully stop the execution of a query without a partial result, the user should send 2 cancel requests.
|
||||
|
||||
**Example without setting on Ctrl+C**
|
||||
```sql
|
||||
|
@ -175,6 +175,9 @@ bool PullingAsyncPipelineExecutor::pull(Block & block, uint64_t milliseconds)
|
||||
|
||||
void PullingAsyncPipelineExecutor::cancel()
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
/// Cancel execution if it wasn't finished.
|
||||
cancelWithExceptionHandling([&]()
|
||||
{
|
||||
@ -194,6 +197,9 @@ void PullingAsyncPipelineExecutor::cancel()
|
||||
|
||||
void PullingAsyncPipelineExecutor::cancelReading()
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
/// Stop reading from source if pipeline wasn't finished.
|
||||
cancelWithExceptionHandling([&]()
|
||||
{
|
||||
@ -203,9 +209,6 @@ void PullingAsyncPipelineExecutor::cancelReading()
|
||||
|
||||
void PullingAsyncPipelineExecutor::cancelWithExceptionHandling(CancelFunc && cancel_func)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
if (!data->is_finished && data->executor)
|
||||
|
Loading…
Reference in New Issue
Block a user