Skip to content

Fix array join optimisation for MV#15717

Merged
KochetovNicolai merged 2 commits intomasterfrom
fix-array-join-optimisation-for-mv
Oct 7, 2020
Merged

Fix array join optimisation for MV#15717
KochetovNicolai merged 2 commits intomasterfrom
fix-array-join-optimisation-for-mv

Conversation

@KochetovNicolai
Copy link
Copy Markdown
Member

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

Changelog category (leave one):

  • Bug Fix

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix error Cannot find column which may happen at insertion into MATERIALIZED VIEW in case if query for MV containes ARRAY JOIN.

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Oct 7, 2020
@KochetovNicolai
Copy link
Copy Markdown
Member Author

KochetovNicolai commented Oct 7, 2020

Reasons of error are:

  1. StorageValues, used for MV, returned more columns then required in IStorage::read()
  2. Optimisation for ARRAY JOIN added PROJECT action for input columns

As long as set of columns known by ExpressionActions was less then set of columns used by ArrayJoinStep from query plan, PROJECT removed some expected columns.

This pr fixes both 1. and 2. just in case.

@KochetovNicolai
Copy link
Copy Markdown
Member Author

Crash in fuzzer the same as in #15237

@nikitamikhaylov nikitamikhaylov self-assigned this Oct 7, 2020
@KochetovNicolai KochetovNicolai merged commit 54e77e9 into master Oct 7, 2020
@KochetovNicolai KochetovNicolai deleted the fix-array-join-optimisation-for-mv branch October 7, 2020 17:19
KochetovNicolai added a commit that referenced this pull request Oct 8, 2020
Backport #15717 to 20.9: Fix array join optimisation for MV
KochetovNicolai added a commit that referenced this pull request Oct 16, 2020
Backport #15717 to 20.8: Fix array join optimisation for MV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-docs-needed pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants