Reproducer: 
``` sql
SELECT count() FROM (SELECT queryID() AS t FROM remote('127.0.0.{1..3}', numbers(10)) WITH TOTALS HAVING t = initialQueryID())

Code: 49. DB::Exception: Received from localhost:9000. DB::Exception: Chunk info was not set for chunk in GroupingAggregatedTransform.. (LOGICAL_ERROR)
``` 
column_ast->formatForErrorMessage());
            }
            desc.partition_by.push_back(SortColumnDescription(
                    with_alias->getColumnName(), 1 ,
                    1 ));
            auto actions_dag = std::make_shared<ActionsDAG>(aggregated_columns);
            getRootActions(column_ast, false, actions_dag);
            desc.partition_by_actions.push_back(std::move(actions_dag));
        }
    }
    if (definition.order_by)
    {
        for (const auto & column_ast
            : definition.order_by->children)
        {
            
            const auto & order_by_element
                = column_ast->as<ASTOrderByElement &>();
            
            desc.order_by.push_back(
                SortColumnDescription(
                    order_by_element.children.front()->getColumnName(),
                    order_by_element.direction,
                    order_by_element.nulls_direction));
            auto actions_dag = std::make_shared<ActionsDAG>(aggregated_columns);
            getRootActions(column_ast, false, actions_dag);
            desc.order_by_actions.push_back(std::move(actions_dag));
        }
    }
    desc.full_sort_description = desc.partition_by;