Add materialization when building indices in vertical merge

This commit is contained in:
Alexander Gololobov 2024-09-10 20:57:55 +02:00
parent 2f15fcd23f
commit d4aa06524b

View File

@ -952,6 +952,7 @@ MergeTask::VerticalMergeRuntimeContext::PreparedColumnPipeline MergeTask::Vertic
indexes_to_recalc = MergeTreeIndexFactory::instance().getMany(indexes_it->second);
auto indices_expression_dag = indexes_it->second.getSingleExpressionForIndices(global_ctx->metadata_snapshot->getColumns(), global_ctx->data->getContext())->getActionsDAG().clone();
indices_expression_dag.addMaterializingOutputActions(); /// Const columns cannot be written without materialization.
auto calculate_indices_expression_step = std::make_unique<ExpressionStep>(
merge_column_query_plan.getCurrentDataStream(),
std::move(indices_expression_dag));