mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-12 09:22:05 +00:00
fix
This commit is contained in:
parent
3cad26dc71
commit
541c641b24
@ -76,8 +76,6 @@ public:
|
||||
virtual IndexConditionPtr createIndexCondition(
|
||||
const SelectQueryInfo & query_info, const Context & context) const = 0;
|
||||
|
||||
virtual void writeText(WriteBuffer & ostr) const = 0;
|
||||
|
||||
String name;
|
||||
ExpressionActionsPtr expr;
|
||||
size_t granularity;
|
||||
|
@ -28,15 +28,15 @@ struct MergeTreeTestGranule : public MergeTreeIndexGranule {
|
||||
}
|
||||
|
||||
bool empty() const override {
|
||||
return static_cast<bool>(emp);
|
||||
return emp == 0;
|
||||
}
|
||||
|
||||
void update(const Block &block, size_t *pos, size_t limit) override {
|
||||
*pos += std::min(limit, block.rows() - *pos);
|
||||
emp = rand();
|
||||
emp = 10;
|
||||
};
|
||||
|
||||
Int32 emp = true;
|
||||
Int32 emp = 0;
|
||||
};
|
||||
|
||||
class IndexTestCondition : public IndexCondition{
|
||||
@ -75,9 +75,6 @@ public:
|
||||
return std::make_shared<IndexTestCondition>();
|
||||
};
|
||||
|
||||
void writeText(WriteBuffer & ostr) const override {
|
||||
DB::writeText(10, ostr);
|
||||
};
|
||||
};
|
||||
|
||||
std::unique_ptr<MergeTreeIndex> MTItestCreator(
|
||||
|
@ -548,11 +548,11 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm
|
||||
{
|
||||
const auto index = storage.indexes[i];
|
||||
auto & stream = *skip_indexes_streams[i];
|
||||
size_t prev_mark = 0;
|
||||
size_t prev_pos = 0;
|
||||
|
||||
while (prev_mark < rows) {
|
||||
while (prev_pos < rows) {
|
||||
size_t limit = 0;
|
||||
if (prev_mark == 0 && index_offset != 0)
|
||||
if (prev_pos == 0 && index_offset != 0)
|
||||
{
|
||||
limit = index_offset;
|
||||
}
|
||||
@ -571,10 +571,10 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm
|
||||
}
|
||||
}
|
||||
|
||||
size_t pos = prev_mark;
|
||||
size_t pos = prev_pos;
|
||||
skip_indexes_granules[i]->update(block, &pos, limit);
|
||||
|
||||
if (pos == prev_mark + limit) {
|
||||
if (pos == prev_pos + limit) {
|
||||
++skip_index_filling[i];
|
||||
|
||||
/// write index if it is filled
|
||||
@ -584,7 +584,7 @@ void MergedBlockOutputStream::writeImpl(const Block & block, const IColumn::Perm
|
||||
skip_index_filling[i] = 0;
|
||||
}
|
||||
}
|
||||
prev_mark = pos;
|
||||
prev_pos = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user