mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Update comment for query AST cloning during inesrt into multiple local shards
Refs: https://github.com/ClickHouse/ClickHouse/pull/18264#discussion_r558839456
This commit is contained in:
parent
d2366b5c6c
commit
858f07c796
@ -352,7 +352,12 @@ DistributedBlockOutputStream::runWritingJob(DistributedBlockOutputStream::JobRep
|
||||
/// Forward user settings
|
||||
job.local_context = std::make_unique<Context>(context);
|
||||
|
||||
/// InterpreterInsertQuery is modifying the AST, but the same AST is also used to insert to remote shards.
|
||||
/// Copying of the query AST is required to avoid race,
|
||||
/// in case of INSERT into multiple local shards.
|
||||
///
|
||||
/// Since INSERT into local node uses AST,
|
||||
/// and InterpreterInsertQuery::execute() is modifying it,
|
||||
/// to resolve tables (in InterpreterInsertQuery::getTable())
|
||||
auto copy_query_ast = query_ast->clone();
|
||||
|
||||
InterpreterInsertQuery interp(copy_query_ast, *job.local_context);
|
||||
|
Loading…
Reference in New Issue
Block a user