mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
polishing
This commit is contained in:
parent
5a9acac12f
commit
1fb0292fcb
@ -47,19 +47,20 @@ bool FillingRow::operator==(const FillingRow & other) const
|
||||
|
||||
bool FillingRow::next(const FillingRow & to_row)
|
||||
{
|
||||
const size_t row_size = size();
|
||||
size_t pos = 0;
|
||||
|
||||
/// Find position we need to increment for generating next row.
|
||||
for (size_t s = size(); pos < s; ++pos)
|
||||
for (; pos < row_size; ++pos)
|
||||
if (!row[pos].isNull() && !to_row.row[pos].isNull() && !equals(row[pos], to_row.row[pos]))
|
||||
break;
|
||||
|
||||
if (pos == size() || less(to_row.row[pos], row[pos], getDirection(pos)))
|
||||
if (pos == row_size || less(to_row.row[pos], row[pos], getDirection(pos)))
|
||||
return false;
|
||||
|
||||
/// If we have any 'fill_to' value at position greater than 'pos',
|
||||
/// we need to generate rows up to 'fill_to' value.
|
||||
for (size_t i = size() - 1; i > pos; --i)
|
||||
for (size_t i = row_size - 1; i > pos; --i)
|
||||
{
|
||||
if (getFillDescription(i).fill_to.isNull() || row[i].isNull())
|
||||
continue;
|
||||
@ -85,7 +86,7 @@ bool FillingRow::next(const FillingRow & to_row)
|
||||
{
|
||||
bool is_less = false;
|
||||
size_t i = pos + 1;
|
||||
for (; i < size(); ++i)
|
||||
for (; i < row_size; ++i)
|
||||
{
|
||||
const auto & fill_from = getFillDescription(i).fill_from;
|
||||
if (!fill_from.isNull())
|
||||
|
@ -273,6 +273,7 @@ IProcessor::Status FillingTransform::prepare()
|
||||
}
|
||||
|
||||
generate_suffix = true;
|
||||
/// return Ready to call transform() for generating filling rows after latest chunk was processed
|
||||
return Status::Ready;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user