mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Add comment for used_flags in hash join, fix build
This commit is contained in:
parent
01a6e01ad7
commit
776b682f28
@ -87,6 +87,9 @@ public:
|
||||
bool isInserted() const { return inserted; }
|
||||
};
|
||||
|
||||
/// FindResult optionally may contain pointer to value and offset in hashtable buffer.
|
||||
/// Only bool found is required.
|
||||
/// So we will have 4 different specializations for FindResultImpl
|
||||
class FindResultImplBase
|
||||
{
|
||||
bool found;
|
||||
@ -241,6 +244,8 @@ protected:
|
||||
{
|
||||
if constexpr (Cache::consecutive_keys_optimization)
|
||||
{
|
||||
/// It's possible to support such combination, but code will became more complex.
|
||||
/// Now there's not place where we need this options enabled together
|
||||
static_assert(!FindResult::has_offset, "`consecutive_keys_optimization` and `has_offset` are conflicting options");
|
||||
if (cache.check(key))
|
||||
{
|
||||
|
@ -476,6 +476,10 @@ public:
|
||||
|
||||
size_t getBufferSizeInCells() const { return NUM_CELLS; }
|
||||
|
||||
/// Return offset for result in internal buffer.
|
||||
/// Result can have value up to `getBufferSizeInCells() + 1`
|
||||
/// because offset for zero value considered to be 0
|
||||
/// and for other values it will be `offset in buffer + 1`
|
||||
size_t offsetInternal(ConstLookupResult ptr) const
|
||||
{
|
||||
if (ptr->isZero(*this))
|
||||
|
@ -1214,6 +1214,10 @@ public:
|
||||
return grower.bufSize();
|
||||
}
|
||||
|
||||
/// Return offset for result in internal buffer.
|
||||
/// Result can have value up to `getBufferSizeInCells() + 1`
|
||||
/// because offset for zero value considered to be 0
|
||||
/// and for other values it will be `offset in buffer + 1`
|
||||
size_t offsetInternal(ConstLookupResult ptr) const
|
||||
{
|
||||
if (ptr->isZero(*this))
|
||||
|
@ -57,6 +57,7 @@ struct NotProcessedCrossJoin : public ExtraBlock
|
||||
|
||||
namespace JoinStuff
|
||||
{
|
||||
/// Version of `getUsed` with dynamic dispatch
|
||||
bool JoinUsedFlags::getUsedSafe(size_t i) const
|
||||
{
|
||||
if (flags.empty())
|
||||
@ -576,6 +577,7 @@ namespace
|
||||
APPLY_FOR_JOIN_VARIANTS(M)
|
||||
#undef M
|
||||
}
|
||||
__builtin_unreachable();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,9 @@ private:
|
||||
|
||||
/// Right table data. StorageJoin shares it between many Join objects.
|
||||
std::shared_ptr<RightTableData> data;
|
||||
/// Flags that indicate that particular row already used in join.
|
||||
/// Flag is stored for every record in hash map.
|
||||
/// Number of this flags equals to hashtable buffer size (plus one for zero value).
|
||||
mutable JoinStuff::JoinUsedFlags used_flags;
|
||||
Sizes key_sizes;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user