diff --git a/src/Processors/Transforms/Streaming/WatermarkTransformWithSubstream.cpp b/src/Processors/Transforms/Streaming/WatermarkTransformWithSubstream.cpp index 151827486e..46a66a9fd3 100644 --- a/src/Processors/Transforms/Streaming/WatermarkTransformWithSubstream.cpp +++ b/src/Processors/Transforms/Streaming/WatermarkTransformWithSubstream.cpp @@ -107,6 +107,8 @@ void WatermarkTransformWithSubstream::work() assert(output_iter == output_chunks.end()); output_chunks.clear(); + SCOPE_EXIT({ output_iter = output_chunks.begin(); }); + /// We will need clear input_chunk for next run Chunk process_chunk; process_chunk.swap(input_chunk);