-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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 early constant folding for isNull/isNotNul and analyzer. #64695
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c9ce136
Fix early constant folding for isNull/isNotNul and analyzer.
KochetovNicolai c45f574
Merge branch 'master' into fix-early-const-folding-analyzer
KochetovNicolai c8def45
Fixing tests.
KochetovNicolai c108c51
Fixing test.
KochetovNicolai 0525eeb
Fixing test.
KochetovNicolai 90fdcaa
Merge branch 'master' into fix-early-const-folding-analyzer
KochetovNicolai 2131877
Fixing other tests.
KochetovNicolai 6baae1d
Merge branch 'master' into fix-early-const-folding-analyzer
KochetovNicolai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,8 +539,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo | |
if (query_node.hasWhere()) | ||
{ | ||
where_analysis_result_optional = analyzeFilter(query_node.getWhere(), current_output_columns, planner_context, actions_chain); | ||
where_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
if (where_analysis_result_optional) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can it be "empty"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are returning std::nullopt if where condition is constant 1. |
||
{ | ||
where_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
} | ||
} | ||
|
||
auto aggregation_analysis_result_optional = analyzeAggregation(query_tree, current_output_columns, planner_context, actions_chain); | ||
|
@@ -553,8 +556,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo | |
if (query_node.hasHaving()) | ||
{ | ||
having_analysis_result_optional = analyzeFilter(query_node.getHaving(), current_output_columns, planner_context, actions_chain); | ||
having_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
if (having_analysis_result_optional) | ||
{ | ||
having_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
} | ||
} | ||
|
||
auto window_analysis_result_optional = analyzeWindow(query_tree, current_output_columns, planner_context, actions_chain); | ||
|
@@ -567,8 +573,11 @@ PlannerExpressionsAnalysisResult buildExpressionAnalysisResult(const QueryTreeNo | |
if (query_node.hasQualify()) | ||
{ | ||
qualify_analysis_result_optional = analyzeFilter(query_node.getQualify(), current_output_columns, planner_context, actions_chain); | ||
qualify_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
if (qualify_analysis_result_optional) | ||
{ | ||
qualify_action_step_index_optional = actions_chain.getLastStepIndex(); | ||
current_output_columns = actions_chain.getLastStepAvailableOutputColumns(); | ||
} | ||
} | ||
|
||
auto projection_analysis_result = analyzeProjection(query_node, current_output_columns, planner_context, actions_chain); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
1 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
That's an interesting change. Is it because of distributed execution?
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.
No. Looks like variant just always can be nullable, this is implemented in selector.