diff --git a/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp b/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp index 6b7a6b66605..978724137f8 100644 --- a/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp +++ b/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp @@ -803,10 +803,9 @@ Pipe MergeTreeDataSelectExecutor::readFromParts( if (query_info.prewhere_info && query_info.prewhere_info->remove_columns_actions) { - auto remove_actions = query_info.prewhere_info->remove_columns_actions->buildExpressions(); - res.addSimpleTransform([&remove_actions](const Block & header) + res.addSimpleTransform([&query_info](const Block & header) { - return std::make_shared(header, remove_actions); + return std::make_shared(header, query_info.prewhere_info->remove_columns_actions); }); }