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

Support toUInt8/toInt8 for if constant condition optimization. #31866

Merged
merged 2 commits into from
Nov 30, 2021

Conversation

KochetovNicolai
Copy link
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Fixes #31687

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 26, 2021
@KochetovNicolai KochetovNicolai added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Nov 26, 2021
@@ -49,6 +49,16 @@ static bool tryExtractConstValueFromCondition(const ASTPtr & condition, bool & v
}
}
}
else if (function->name == "toUInt8" || function->name == "toInt8")
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need OptimizeIfWithConstantCondition?
Also maybe make a setting to disable this optimization?

Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like we need it, there is no other way to skip unused columns

Copy link
Member

Choose a reason for hiding this comment

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

Where exactly it is needed?

Copy link
Member

@alexey-milovidov alexey-milovidov left a comment

Choose a reason for hiding this comment

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

The change looks ad-hoc.

@alexey-milovidov
Copy link
Member

What if any other function will be used?

@alexey-milovidov alexey-milovidov self-assigned this Nov 26, 2021
@alexey-milovidov alexey-milovidov merged commit bab8ea1 into master Nov 30, 2021
@alexey-milovidov alexey-milovidov deleted the fix-31687 branch November 30, 2021 02:54
robot-clickhouse pushed a commit that referenced this pull request Nov 30, 2021
robot-clickhouse pushed a commit that referenced this pull request Nov 30, 2021
robot-clickhouse pushed a commit that referenced this pull request Nov 30, 2021
robot-clickhouse pushed a commit that referenced this pull request Nov 30, 2021
robot-clickhouse pushed a commit that referenced this pull request Nov 30, 2021
KochetovNicolai added a commit that referenced this pull request Dec 2, 2021
Backport #31866 to 21.11: Support toUInt8/toInt8 for if constant condition optimization.
KochetovNicolai added a commit that referenced this pull request Dec 2, 2021
Backport #31866 to 21.3: Support toUInt8/toInt8 for if constant condition optimization.
KochetovNicolai added a commit that referenced this pull request Dec 2, 2021
Backport #31866 to 21.9: Support toUInt8/toInt8 for if constant condition optimization.
KochetovNicolai added a commit that referenced this pull request Dec 2, 2021
Backport #31866 to 21.10: Support toUInt8/toInt8 for if constant condition optimization.
KochetovNicolai added a commit that referenced this pull request Dec 2, 2021
Backport #31866 to 21.8: Support toUInt8/toInt8 for if constant condition optimization.
@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-must-backport Pull request should be backported intentionally. Use this label with great care! pr-not-for-changelog This PR should not be mentioned in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing unused column in "if" expression when upgrading to 21.11.4.14
4 participants