Implement method "structureEquals" for ColumnAggregateFunction

This commit is contained in:
Alexey Milovidov 2020-02-26 21:32:15 +03:00
parent 1c3b1fe353
commit 3e3cafc487
2 changed files with 17 additions and 0 deletions

View File

@ -157,6 +157,21 @@ void ColumnAggregateFunction::ensureOwnership()
} }
bool ColumnAggregateFunction::structureEquals(const IColumn & to) const
{
const auto * to_concrete = typeid_cast<const ColumnAggregateFunction *>(&to);
if (!to_concrete)
return false;
/// AggregateFunctions must be the same.
const IAggregateFunction & func_this = *func;
const IAggregateFunction & func_to = *to_concrete->func;
return typeid(func_this) == typeid(func_to);
}
void ColumnAggregateFunction::insertRangeFrom(const IColumn & from, size_t start, size_t length) void ColumnAggregateFunction::insertRangeFrom(const IColumn & from, size_t start, size_t length)
{ {
const ColumnAggregateFunction & from_concrete = assert_cast<const ColumnAggregateFunction &>(from); const ColumnAggregateFunction & from_concrete = assert_cast<const ColumnAggregateFunction &>(from);

View File

@ -204,6 +204,8 @@ public:
} }
void getExtremes(Field & min, Field & max) const override; void getExtremes(Field & min, Field & max) const override;
bool structureEquals(const IColumn &) const override;
}; };