```
/4/ :) SELECT arrayJoin([1, 2])  GROUP BY 1 WITH TOTALS FORMAT JSON

{
	"meta":
	[
		{
			"name": "arrayJoin([1, 2])",
			"type": "UInt8"
		}
	],

	"data":
	[
		{
			"arrayJoin([1, 2])": 1
		},
		{
			"arrayJoin([1, 2])": 2
		}← Progress: 0.00 rows, 0.00 B (0.00 rows/s., 0.00 B/s.) Logical error: 'Got 2 in totals chunk, expected 1'.
clickhouse-client: /home/akuzm/ch4/ch/src/Common/Exception.cpp:45: DB::Exception::Exception(const std::string &, int): Assertion `false' failed.
Aborted (core dumped)
```


const Block & header,
    bool overflow_row_,
    const ExpressionActionsPtr & expression_,
    const std::string & filter_column_,
    TotalsMode totals_mode_,
    double auto_include_threshold_,
    bool final_)
    : ISimpleTransform(header, transformHeader(header, expression_, final_), true)
    , overflow_row(overflow_row_)
    , expression(expression_)
    , filter_column_name(filter_column_)
    , totals_mode(totals_mode_)
    , auto_include_threshold(auto_include_threshold_)
    , final(final_)
{
    if (!filter_column_name.empty())
        filter_column_pos = outputs.front().getHeader().getPositionByName(filter_column_name);
    finalized_header = getInputPort().getHeader();
    finalizeBlock(finalized_header);
    
    if (expression)
    {
        auto totals_header = finalized_header;
        expression->execute(totals_header);
        outputs.emplace_back(totals_header, this);
    }
    else
        outputs.emplace_back(finalized_header, this);