aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Processors/Sources/SourceFromChunks.cpp
blob: 9fad508c23b153798f2ad95cc514afc9e766456e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <Processors/Sources/SourceFromChunks.h>

namespace DB
{

SourceFromChunks::SourceFromChunks(Block header, Chunks chunks_)
    : ISource(std::move(header))
    , chunks(std::move(chunks_))
    , it(chunks.begin())
{}

String SourceFromChunks::getName() const
{
    return "SourceFromChunks";
}

Chunk SourceFromChunks::generate()
{
    if (it != chunks.end())
    {
        Chunk && chunk = std::move(*it);
        it++;
        return chunk;
    }
    else
        return {};
}

}