Always remove unused actipns from addMissingDefaults

This commit is contained in:
Nikolai Kochetov 2022-02-14 12:49:07 +00:00
parent ea3ccd2431
commit ebb5d1807d

View File

@ -83,10 +83,9 @@ ActionsDAGPtr addMissingDefaults(
/// Computes explicitly specified values by default and materialized columns.
if (auto dag = evaluateMissingDefaults(actions->getResultColumns(), required_columns, columns, context, true, null_as_default))
actions = ActionsDAG::merge(std::move(*actions), std::move(*dag));
else
/// Removes unused columns and reorders result.
/// The same is done in evaluateMissingDefaults if not empty dag is returned.
actions->removeUnusedActions(required_columns.getNames());
/// Removes unused columns and reorders result.
actions->removeUnusedActions(required_columns.getNames(), false);
return actions;
}