diff --git a/src/Storages/Distributed/DistributedBlockOutputStream.cpp b/src/Storages/Distributed/DistributedBlockOutputStream.cpp index e85cb227310..70e3ef0f17a 100644 --- a/src/Storages/Distributed/DistributedBlockOutputStream.cpp +++ b/src/Storages/Distributed/DistributedBlockOutputStream.cpp @@ -352,6 +352,7 @@ DistributedBlockOutputStream::runWritingJob(DistributedBlockOutputStream::JobRep /// Forward user settings job.local_context = std::make_unique(context); + /// InterpreterInsertQuery is modifying the AST, but the same AST is also used to insert to remote shards. auto copy_query_ast = query_ast->clone(); InterpreterInsertQuery interp(copy_query_ast, *job.local_context);