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 reading from type object #35687

Merged
merged 1 commit into from
Mar 29, 2022
Merged

Conversation

CurtizJ
Copy link
Member

@CurtizJ CurtizJ commented Mar 28, 2022

Changelog category (leave one):

  • Bug Fix (user-visible misbehaviour in official stable or prestable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix possible Can't adjust last granule exception while reading subcolumns of type Object.

Fixes #35407.

@antonio2368 antonio2368 self-assigned this Mar 29, 2022
Comment on lines -96 to -102
auto name_in_storage = Nested::extractTableName(columns[i]);
if (storage_columns.has(name_in_storage) && isObject(storage_columns.get(name_in_storage).type))
{
have_at_least_one_physical_column = true;
continue;
}

Copy link
Member Author

@CurtizJ CurtizJ Mar 29, 2022

Choose a reason for hiding this comment

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

The bug is here actually. Previously we set have_at_least_one_physical_column to true if we read the subcolumn of Object type, but it could be wrong for parts in which this subcolumn is absent. So, in case when we read only this subcolumn without any other physical columns an error accured.

Copy link
Member

@antonio2368 antonio2368 left a comment

Choose a reason for hiding this comment

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

LGTM

@CurtizJ CurtizJ merged commit 1cba31c into ClickHouse:master Mar 29, 2022
@CurtizJ CurtizJ added pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! labels Apr 13, 2022
CurtizJ added a commit that referenced this pull request Apr 14, 2022
Backport #35687 to 22.3: Fix reading from type object
@Felixoid Felixoid added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MergeTreeThread - Can't adjust last granule with Object('JSON') datatype
3 participants