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)
``` 
analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PREFER_PARTIAL_MERGE) ||
        analyzed_join->isEnabledAlgorithm(JoinAlgorithm::PARALLEL_HASH))
    {
        tried_algorithms.push_back(toString(JoinAlgorithm::HASH));
        if (analyzed_join->allowParallelHashJoin())
            return std::make_shared<ConcurrentHashJoin>(context, analyzed_join, settings.max_threads, right_sample_block);
        return std::make_shared<HashJoin>(analyzed_join, right_sample_block);
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::FULL_SORTING_MERGE))
    {
        tried_algorithms.push_back(toString(JoinAlgorithm::FULL_SORTING_MERGE));
        if (FullSortingMergeJoin::isSupported(analyzed_join))
            return std::make_shared<FullSortingMergeJoin>(analyzed_join, right_sample_block);
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::GRACE_HASH))
    {
        tried_algorithms.push_back(toString(JoinAlgorithm::GRACE_HASH));
        if (GraceHashJoin::isSupported(analyzed_join))
            return std::make_shared<GraceHashJoin>(context, analyzed_join, left_sample_block, right_sample_block, context->getTempDataOnDisk());
    }
    if (analyzed_join->isEnabledAlgorithm(JoinAlgorithm::AUTO))
    {
        tried_algorithms.push_back(toString(JoinAlgorithm::AUTO));
        if (MergeJoin::isSupported(analyzed_join))
            return std::make_shared<JoinSwitcher>(analyzed_join, right_sample_block);
    }
    throw Exception(ErrorCodes::NOT_IMPLEMENTED,
        "Can't execute {} join algorithm for this strictness/kind and right storage type",
        fmt::join(tried_algorithms, " or "));