-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregate function states addition [CLICKHOUSE-3723] #3062
Aggregate function states addition [CLICKHOUSE-3723] #3062
Conversation
for (size_t i = 0; i < 2; ++i) | ||
columns[i] = typeid_cast<const ColumnAggregateFunction *>(block.getByPosition(arguments[i]).column.get()); | ||
|
||
auto arena = std::make_shared<Arena>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
auto & vec_to = column_to->getData(); | ||
auto & vec_from = column_from->getData(); | ||
|
||
UInt64 m = block.getByPosition(new_arguments[1]).column->getUInt(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you check that the argument is constant?
(Need to add a test when it is not.)
What if block has size number of rows?
|
||
if (!new_arguments[0]->equals(*new_arguments[1])) | ||
throw Exception("Cannot add aggregate states of different functions: " | ||
+ new_arguments[0]->getFunctionName() + " and " + new_arguments[1]->getFunctionName(), ErrorCodes::CANNOT_ADD_DIFFERENT_AGGREGATE_STATES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message will be misleading when you try to add uniqUpTo(5) and uniqUpTo(10).
throw Exception("Cannot add aggregate states of different functions: " | ||
+ new_arguments[0]->getFunctionName() + " and " + new_arguments[1]->getFunctionName(), ErrorCodes::CANNOT_ADD_DIFFERENT_AGGREGATE_STATES); | ||
|
||
if (!new_arguments[0]->getReturnType()->equals(*new_arguments[1]->getReturnType().get())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this check?
…ICKHOUSE-3723.3
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en