Add reqired right keys to join totals block

This commit is contained in:
vdimir 2021-07-12 18:00:55 +03:00
parent 91330be0af
commit a61b7f2326
No known key found for this signature in database
GPG Key ID: F57B3E10A21DBB31

View File

@ -329,8 +329,12 @@ void joinTotals(const Block & totals, const Block & columns_to_add, const TableJ
if (Block totals_without_keys = totals)
{
const auto & required_right = table_join.requiredRightKeys();
for (const auto & name : table_join.keyNamesRight())
totals_without_keys.erase(totals_without_keys.getPositionByName(name));
{
if (!required_right.contains(name))
totals_without_keys.erase(totals_without_keys.getPositionByName(name));
}
for (auto & col : totals_without_keys)
{