v.23.3New Feature

An option for displaying partial results on query cancelation

An option to display partial result on cancel: Added query setting partial_result_on_first_cancel allowing the canceled query (e.g. due to Ctrl-C) to return a partial result. #45689 (Alexey Perevyshin).
Added the query setting partial_result_on_first_cancel that allows a canceled query (e.g., by pressing Ctrl-C) to return partial results instead of aborting without output.

Why it matters

This feature addresses the problem of losing all query results when a query is canceled prematurely. Users can now receive partial results upon canceling long-running queries, improving interactivity and usability by providing useful data even if the full query cannot complete.

How to use it

Enable the feature by setting the query parameter partial_result_on_first_cancel to 1. For example, include the setting in your query as follows:

SET partial_result_on_first_cancel = 1
SELECT * FROM table


When the query is canceled (e.g., via Ctrl-C), ClickHouse will return whatever partial result was processed up to that point.