Merge pull request #70070 from ClickHouse/backport/24.9/70054

Backport #70054 to 24.9: Remove unused columns from actions in FilterStep.
This commit is contained in:
robot-ch-test-poll 2024-09-27 20:17:26 +02:00 committed by GitHub
commit 43f1be7291
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,10 @@ FilterStep::FilterStep(
, remove_filter_column(remove_filter_column_)
{
actions_dag.removeAliasesForFilter(filter_column_name);
/// Removing aliases may result in unneeded ALIAS node in DAG.
/// This should not be an issue by itself,
/// but it might trigger an issue with duplicated names in Block after plan optimizations.
actions_dag.removeUnusedActions(false, false);
}
void FilterStep::transformPipeline(QueryPipelineBuilder & pipeline, const BuildQueryPipelineSettings & settings)

View File

@ -0,0 +1 @@
1 2024-05-02 00:00:00

View File

@ -0,0 +1 @@
select * from view(select id, toDateTime(date) as date from view(select 1 as id, '2024-05-02' as date)) where date='2024-05-02';