Skip to content
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

Fix group by array low cardinality arguments #4055

Merged
merged 2 commits into from
Jan 29, 2019

Conversation

KochetovNicolai
Copy link
Member

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Category (leave one):

  • Bug Fix

Short description (up to few sentences):
Fixed aggregate functions execution with Array(LowCardinality) arguments. #4038

@alexey-milovidov
Copy link
Member

Does not build (-Wshadow -Werror): variables declared in if are visible in else.

@@ -101,8 +101,10 @@ void NativeBlockOutputStream::write(const Block & block)
/// Send data to old clients without low cardinality type.
if (remove_low_cardinality || (client_revision && client_revision < DBMS_MIN_REVISION_WITH_LOW_CARDINALITY_TYPE))
{
column.column = recursiveRemoveLowCardinality(column.column);
column.type = recursiveRemoveLowCardinality(column.type);
if (auto col = recursiveRemoveLowCardinality(column.column.get()))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't understand the change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main idea is that function recursiveRemoveLowCardinality has changed it's interface. Before function was ColumnPtr -> ColumnPtr, and result was a column without LowCardinality. Now function is IColumn * -> ColumnPtr, and it returns new column only if argument had LowCardinality, and nullptr otherwise.

Reasons:

  • If column doesn't contain LowCardinality, do not create new column object (less impact on ordinary columns).
  • Can use with raw ptr argument (which was used in Aggregator)

@alexey-milovidov alexey-milovidov changed the title Fix group by array low cardibality arguments Fix group by array low cardinality arguments Jan 14, 2019
@alexey-milovidov
Copy link
Member

Can use with raw ptr argument (which was used in Aggregator)

ColumnPtr is intrusive: you can always obtain ColumnPtr from raw ptr.

@alexey-milovidov
Copy link
Member

Your own test has failed.

@KochetovNicolai KochetovNicolai force-pushed the fix-group-by-array-low-cardibality-arguments branch from 822f85e to 21242ad Compare January 29, 2019 15:44
@alexey-milovidov alexey-milovidov merged commit fd5ab9e into master Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants