-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Conversation
@@ -49,6 +49,16 @@ static bool tryExtractConstValueFromCondition(const ASTPtr & condition, bool & v | |||
} | |||
} | |||
} | |||
else if (function->name == "toUInt8" || function->name == "toInt8") |
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.
Do we still need OptimizeIfWithConstantCondition
?
Also maybe make a setting to disable this optimization?
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.
Looks like we need it, there is no other way to skip unused columns
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.
Where exactly it is needed?
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 change looks ad-hoc.
What if any other function will be used? |
…ition optimization.
…ition optimization.
Backport #31866 to 21.11: Support toUInt8/toInt8 for if constant condition optimization.
Backport #31866 to 21.3: Support toUInt8/toInt8 for if constant condition optimization.
Backport #31866 to 21.9: Support toUInt8/toInt8 for if constant condition optimization.
Backport #31866 to 21.10: Support toUInt8/toInt8 for if constant condition optimization.
Backport #31866 to 21.8: Support toUInt8/toInt8 for if constant condition optimization.
Changelog category (leave one):
Fixes #31687