File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1434,8 +1434,13 @@ void ReadFromMergeTree::applyFilters(ActionDAGNodes added_filter_nodes)
14341434 if (query_info.planner_context )
14351435 {
14361436 const auto & table_expression_data = query_info.planner_context ->getTableExpressionDataOrThrow (query_info.table_expression );
1437+ const auto & alias_column_expressions = table_expression_data.getAliasColumnExpressions ();
14371438 for (const auto & [column_identifier, column_name] : table_expression_data.getColumnIdentifierToColumnName ())
14381439 {
1440+ // / ALIAS columns cannot be used in the filter expression without being calculated in ActionsDAG,
1441+ // / so they should not be added to the input nodes.
1442+ if (alias_column_expressions.contains (column_name))
1443+ continue ;
14391444 const auto & column = table_expression_data.getColumnOrThrow (column_name);
14401445 node_name_to_input_node_column.emplace (column_identifier, ColumnWithTypeAndName (column.type , column_name));
14411446 }
You can’t perform that action at this time.
0 commit comments