diff --git a/dbms/src/Interpreters/ExpressionActions.cpp b/dbms/src/Interpreters/ExpressionActions.cpp index 5b942843d92..f472416f689 100644 --- a/dbms/src/Interpreters/ExpressionActions.cpp +++ b/dbms/src/Interpreters/ExpressionActions.cpp @@ -288,7 +288,8 @@ void ExpressionAction::prepare(Block & sample_block) } } -size_t ExpressionAction::getInputRowsCount(Block & block, std::unordered_map & input_rows_counts) const { +size_t ExpressionAction::getInputRowsCount(Block & block, std::unordered_map & input_rows_counts) const +{ auto it = input_rows_counts.find(row_projection_column); size_t projection_space_dimension; if (it == input_rows_counts.end()) @@ -314,6 +315,7 @@ size_t ExpressionAction::getInputRowsCount(Block & block, std::unordered_mapsize(); } + return is_row_projection_complementary ? parent_space_dimension - projection_space_dimension : projection_space_dimension; }