```
/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)
```


{
    factory.registerOutputFormatProcessor("Template", [](
            WriteBuffer & buf,
            const Block & sample,
            FormatFactory::WriteCallback,
            const FormatSettings & settings)
    {
        ParsedTemplateFormatString resultset_format;
        if (settings.template_settings.resultset_format.empty())
        {
            
            resultset_format.delimiters.resize(2);
            resultset_format.formats.emplace_back(ParsedTemplateFormatString::ColumnFormat::None);
            resultset_format.format_idx_to_column_idx.emplace_back(0);
            resultset_format.column_names.emplace_back("data");
        }
        else
        {