Thankfully "partial merge join" is disabled by default.

```
milovidov-desktop :) SET max_block_size = 6, join_algorithm = 'partial_merge'

SET max_block_size = 6, join_algorithm = 'partial_merge'

Query id: 600704b7-b455-4726-8a9c-8e45b509f2fb

Ok.

0 rows in set. Elapsed: 0.002 sec. 

milovidov-desktop :) SELECT blockSize() bs FROM (SELECT 1 s) js1 ALL RIGHT JOIN (SELECT arrayJoin([2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3]) s) js2 USING (s) GROUP BY bs ORDER BY bs;

SELECT blockSize() AS bs
FROM
(
    SELECT 1 AS s
) AS js1
ALL RIGHT JOIN
(
    SELECT arrayJoin([2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3]) AS s
) AS js2 USING (s)
GROUP BY bs
ORDER BY bs ASC

Query id: ae51c589-4b69-4e90-a3a9-7ef4ead72af9

→ Progress: 2.00 rows, 2.00 B (18.21 rows/s., 18.21 B/s.)
```

Found by stress test.
}
    }
    if constexpr (has_right_nulls)
    {
        if (const auto * right_nullable = checkAndGetColumn<ColumnNullable>(right_column))
        {
            if (right_column.isNullAt(rhs_pos))
                return -null_direction_hint;
            return left_column.compareAt(lhs_pos, rhs_pos, right_nullable->getNestedColumn(), null_direction_hint);
        }
    }
    return left_column.compareAt(lhs_pos, rhs_pos, right_column, null_direction_hint);
}
Block extractMinMax(const Block & block, const Block & keys)
{
    if (block.rows() == 0)
        throw Exception("Unexpected empty block", ErrorCodes::LOGICAL_ERROR);
    Block min_max = keys.cloneEmpty();
    MutableColumns columns = min_max.mutateColumns();
    for (size_t i = 0; i < columns.size(); ++i)
    {
        const auto & src_column = block.getByName(min_max.getByPosition(i).name);
        columns[i]->insertFrom(*src_column.column, 0);
        columns[i]->insertFrom(*src_column.column, block.rows() - 1);
    }
    min_max.setColumns(std::move(columns));
    return min_max;
}
}
class RowBitmaps