2019-09-09 19:43:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
2019-09-10 18:39:10 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <Core/Names.h>
|
2019-09-12 12:24:19 +00:00
|
|
|
#include <Columns/IColumn.h>
|
2019-09-16 12:37:46 +00:00
|
|
|
#include <DataStreams/IBlockStream_fwd.h>
|
2019-09-09 19:43:37 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class Block;
|
|
|
|
|
|
|
|
class IJoin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IJoin() = default;
|
|
|
|
|
|
|
|
/// Add block of data from right hand of JOIN.
|
|
|
|
/// @returns false, if some limit was exceeded and you should not insert more data.
|
|
|
|
virtual bool addJoinedBlock(const Block & block) = 0;
|
|
|
|
|
|
|
|
/// Join the block with data from left hand of JOIN to the right hand data (that was previously built by calls to addJoinedBlock).
|
|
|
|
/// Could be called from different threads in parallel.
|
|
|
|
virtual void joinBlock(Block & block) = 0;
|
|
|
|
|
|
|
|
virtual bool hasTotals() const { return false; }
|
|
|
|
virtual void setTotals(const Block & block) = 0;
|
|
|
|
virtual void joinTotals(Block & block) const = 0;
|
|
|
|
|
2019-09-10 14:51:28 +00:00
|
|
|
virtual size_t getTotalRowCount() const = 0;
|
2019-09-16 12:37:46 +00:00
|
|
|
|
|
|
|
virtual BlockInputStreamPtr createStreamWithNonJoinedRows(const Block &, UInt64) const { return {}; }
|
2019-09-09 19:43:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using JoinPtr = std::shared_ptr<IJoin>;
|
|
|
|
|
2019-09-11 18:03:21 +00:00
|
|
|
}
|