Merge pull request #28135 from amosbird/projection-improve3

Get rid of useless projection columns during merge
This commit is contained in:
Maksim Kita 2021-08-25 22:14:38 +03:00 committed by GitHub
commit 2403686bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -494,7 +494,6 @@ static void extractMergingAndGatheringColumns(
const NamesAndTypesList & storage_columns,
const ExpressionActionsPtr & sorting_key_expr,
const IndicesDescription & indexes,
const ProjectionsDescription & projections,
const MergeTreeData::MergingParams & merging_params,
NamesAndTypesList & gathering_columns, Names & gathering_column_names,
NamesAndTypesList & merging_columns, Names & merging_column_names)
@ -508,13 +507,6 @@ static void extractMergingAndGatheringColumns(
std::inserter(key_columns, key_columns.end()));
}
for (const auto & projection : projections)
{
Names projection_columns_vec = projection.required_columns;
std::copy(projection_columns_vec.cbegin(), projection_columns_vec.cend(),
std::inserter(key_columns, key_columns.end()));
}
/// Force sign column for Collapsing mode
if (merging_params.mode == MergeTreeData::MergingParams::Collapsing)
key_columns.emplace(merging_params.sign_column);
@ -728,7 +720,6 @@ MergeTreeData::MutableDataPartPtr MergeTreeDataMergerMutator::mergePartsToTempor
storage_columns,
metadata_snapshot->getSortingKey().expression,
metadata_snapshot->getSecondaryIndices(),
metadata_snapshot->getProjections(),
merging_params,
gathering_columns,
gathering_column_names,